QUESTION: ifstream of char variable

char id[10], g[10];
double h[10], w[10];
char ID, gender;
double height, weight;
cout << "To complete entering data, enter 'x' or 'X' for 'Character ID'\n";
for(;;)
{
cout<<"Enter your Character ID:\n";
cin>>ID;
if (ID=='x' || ID=='X')
break;
else
stats>>ID>>"\t ";
......
}
On the line reading " stats>>ID>>"\t ";
I receive the error code "error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'const char [5]' (or there is no acceptable conversion)"

NOTE I do use the array id[10] later, but I don't understand why the error code is referencing an array const char [5].

I can include the entire code if desired, but mind it is very long.
What are you trying to do with stats? If it really is an ifstream, you can't get things into a string literal like you are trying to do there. It is like trying to do std::cin>>"whatever";, it doesn't make sense.
Sorry to waste your time, I found multiple error with the entire program and fixed this one. I had confused language for ofstream and ifstream. Thank you
Topic archived. No new replies allowed.