To All,
I was trying to learn c++ using the tutorials posted on cprogramming.com when I encountered a problem. I copied the codes directly from the website, but there is some errors. Can someone tell me what is the problem?
There are more errors but I did not put them all in. What should I do?
Thanks in advance.
Errors:
[warning] in function 'int main()':
line 4: [warning] overflow in implicit constant conversion
line 6: no matching function for call to '_io_stream_withassign::getline(char &, int, char)'
code:
#include <iostream.h>
int main()
{
char string(256);
cout<< "Please enter a long string";
cin.getline(string, 256, '\n');
cout<< "Your long string was: "<< endl<<string;
return 0;
}