Hi,
I am having problem in compiling the following piece of simple code(it didn't work in any of the compilers VC++,GCC etc)
#include<iostream>
using namespace std;
int main()
{
while((char c = cin.get()) != 'q')
cout<<endl<<"Character printed = "<<c<<endl;
}
ERRORS: expected primary-expression before "char"
expected `)' before "char"
expected `)' before ';' token
but the following works:
#include<iostream>
using namespace std;
int main()
{
while(char c = cin.get() != 'q')
cout<<endl<<"Character printed = "<<c<<endl;
}