-
Quick Help Neeeded
can someone please help me I was told by my tutor to remove this piece of code from my program:
Code:
char word[50];
char word1[25];
He also specified that I use a C++ function rather than the
Code:
length=strlen(word);
and the code
Code:
(!strcmpi (word, word1))
And i'm really confused, can someone tell me how i can change these to using alternatives to these, as an example the length=strlen(word) to being word.substr????? im not sure? I am not sure what she meant, and I'm reallllllllllyyy confused. I need some help please help i would appreciate your help dearly.
-
He probably meant for you to use the C++ std::string
-
Maybe she is telling you to use c++ style strings defined in the <string> header
-
k, so you mean...
I should get rid of like she said, then for the fin.getline, I can use:
?Thanks for the help by the way
-
You can use
Code:
string word;
word.length();
instead of
Code:
char word[N];
strlen(word);