question about getchar()

hi
maybe someone can help me
i want to use while loop until EOF to get characters
but in the same time to find if there is sequence like "word" in the text that entered
while(c=getchar() != EOF)
{

how can i find the sequence of characters?
You could use getline( file, input, '\n' );.

Save to a string and then do a check on it.
1
2
if( input == "word" )
   /* code */


'\n' is a newline character.
ok i will try your advice

i have a test this sunday and i try to solve some exrecises hope i secceed

thank you !!
did you mean to c language not c++ right?
It looks like C++ to me.
Ahh sorry, that was c++. Being a c++ forum and all... lol
Topic archived. No new replies allowed.