Are there known problems with C++ and Project Builder?
I'm trying to teach myself some programming by reading the tutorials on
www.cplusplus.com and have hit a snag with the cin.getline() function,e.g
the following program:
// cin with strings
#include <iostream.h>
int main ()
{
char mybuffer [100];
cout << "What's your name? ";
cin.getline (mybuffer,100);
cout << "Hello " << mybuffer << ".\n";
cout << "Which is your favourite team? ";
cin.getline (mybuffer,100);
cout << "I like " << mybuffer << " too.\n";
return 0;
}
When pasted into a C++ file, saved with a .cpp extension and compiled using c++ .... in the terminal window produces an application which does not work as it is supposed to.
For some reason it wants the cin completed before it does the cout prompt for it...
, which makes it a little confusing.
Any ideas as to what might be wrong?
Cheers
Jeff