-
load to an array?
Alot of experimentation... this is awesome and key to learning code definately; it's just that even through extreme research via the Net I am having trouble finding and understanding (mostly understanding) one little element: how does one take standard user input(string) parse it in search of one word, then place this wordin in an array (a holding place where it can stand and be used in forward function) I hate to ask for help, but sometimes thats the only way to learn.
Thanks, reRanger
-
Well, if you already know the word that you're looking for, you can just do this:
Code:
char word[] = "hello";
No input or searching required.
OK, seriously, if you're using C style functions you use strstr() to find the word and strncpy() to copy a certain number of characters from one array to the other.
If you're using the C++ string class you use the find() member function to find the word you are looking for and the substr() member function to extract it.