I'm currenty using a given .txt file and comparing the first word (the correct word) to a list words. I need to see where the error is in the incorrect words, so I'm trying to convert it to a character array after I have read the word in as a string. Any idea how I would do this.
I wrote below what I thought would be simple solution it doesn't work
code:
string wORD;
char x[10];
inFile<<wORD;
char x[10] = wORD;
error is:
cannot convert from 'std::string' to 'char [10]'
What approach I should be taking?
I wrote below what I thought would be simple solution it doesn't work
code:
string wORD;
char x[10];
inFile<<wORD;
char x[10] = wORD;
error is:
cannot convert from 'std::string' to 'char [10]'
What approach I should be taking?