I got this example from "Sam's teach yourself c++ in 21 days" and it doesnt work on Dev-C++. I've tryed evrything and the only way i can get it to work is by adding the third parameter in cin.get (which by the way every char works except for '\n')
Can anyone Please help?
<<<<<<<<<<CODE<<<<<<<<<<
char buffer[80];
cout << "Enter the string: ";
cin.get(buffer, 79); // get up to 79 or newline
cout << "Here's the buffer: " << buffer << endl;
<<<<<<<<<<CODE<<<<<<<<<<
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hmmm...
This code seems to work fine for me. Try this:
Tools -> Check for Updates/Packages
<click start>
see if there is a new version of the main executable for the IDE. Make sure that your copy of MinGW is up to date as well.
Might also see if you have a memory leak earlier in your program. This can cause wierd errors like this one.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got this example from "Sam's teach yourself c++ in 21 days" and it doesnt work on Dev-C++. I've tryed evrything and the only way i can get it to work is by adding the third parameter in cin.get (which by the way every char works except for '\n')
Can anyone Please help?
<<<<<<<<<<CODE<<<<<<<<<<
char buffer[80];
cout << "Enter the string: ";
cin.get(buffer, 79); // get up to 79 or newline
cout << "Here's the buffer: " << buffer << endl;
<<<<<<<<<<CODE<<<<<<<<<<
hmmm...
This code seems to work fine for me. Try this:
Tools -> Check for Updates/Packages
<click start>
see if there is a new version of the main executable for the IDE. Make sure that your copy of MinGW is up to date as well.
Might also see if you have a memory leak earlier in your program. This can cause wierd errors like this one.