Hey /prog/, I am writing up a program in C++ and for some reason I keep getting an error.
(part of my code)
char x[51];
cin<<x;
if(x=="^Z")
{
//etc etc
And it keeps giving me an error, I have tried single quotes, double, x==('^', 'Z', '\0'), and many more.
Really, all I need is for it to make the program respond to the user pressing Ctrl + Z then hitting enter.
Name:
Anonymous2008-04-11 1:34
Check for an EOF on your very well-named variable 'x'. Also it's cin >> x. << operator is for cout. And unless you must use a char array, use a string, FFS it's Sepples not C. If that's the only use you have for x giving it 51 chars is retarded.
Name:
Anonymous2008-04-11 1:36
(I should have said check for EOF on the stream actually)
while( cin >> x)
etc.
Name:
Anonymous2009-02-25 7:34
Check and a cure for many runtime problems At least once actual figures.
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy