My question is do you have to be good at math to be a good programer?
Here's my first error:been
legion\scores.cpp(99): Error! E029: col(25) symbol 'getline' has not
declared
for (i = 0; !ins.eof ( ) && i < 10; i++)
{
getline (ins, top_five[i].name, '#');
ins >> top_five[i].score;
eatwhite(ins);
ins >> top_five[i].tnclass;
eatwhite(ins);
}
I don't understand this one.
Nightfox wrote to Jon Justvig <=-
Here's my first error:
legion\scores.cpp(99): Error! E029: col(25) symbol 'getline' has not
been
declared
for (i = 0; !ins.eof ( ) && i < 10; i++)
{
getline (ins, top_five[i].name, '#');
ins >> top_five[i].score;
eatwhite(ins);
ins >> top_five[i].tnclass;
eatwhite(ins);
}
It doesn't know about 'getline'. You can do either of the following:
- Prefix that call with std:: - Example:
std::getline(ins, top_five[i].name, '#');
- After your #include lines, put "using std::getline;" (without the double- quotes)
Also, be sure to #include <string>
This is for the first idea:
leg034.cpp(42): Error! E921: col(18) namespace 'std' not allowed in using-declaration
leg034.cpp(42): Error! E006: col(11) syntax error; probable cause: missing ';'
Re: Programming Is Like tryin
By: Jon Justvig to Nightfox on Mon Dec 28 2015 18:22:00
Can you post the code that is generating those errors? It's difficult to help without seeing the code (what's at columns 18 and 11?). This is what it should look like (underneath your #includes and before your functions):
using namespace std;
It looks like the compiler knows about namespaces, so I'm not sure why std would not be allowed (unless perhaps it's an older compiler and its headers don't declare the standard library things in the std namespace).
Sysop: | MCMLXXIX |
---|---|
Location: | Prospect, CT |
Users: | 325 |
Nodes: | 10 (0 / 10) |
Uptime: | 16:13:09 |
Calls: | 508 |
Messages: | 219976 |