i tried many methods but i still confused. i replace "word" by a char and string var. i put the word from x in another var but it failed. what is wrong with this code ?
#include <iostream>
#include <fstream>
using namespace std;
int main() {
char x[99];
fstream file;
file.open("data.txt",ios::in);
for (int i=1 ; !file.eof() ; i++) {
file.getline(x,99,' ');
if(x=="word")
cout << "found";}
file.close();
return 0;
}