Originally Posted by
avgprogamerjoe
How can I make an array to hold a word in whole.
To answer this part of the question:
Make an array of strings.
Code:
#include <string>
...
string strArray[10];
strArray[0]="Hot dog";//0 is the first element, remember.
if(strArray[i]=="Hot dog")
...
Or better yet a vector of strings:
Code:
#include <string>
#include <vector>
...
vector<string> strArray(10);
strArray[0]="Hot dog";//0 is the first element, remember.
if(strArray[i]=="Hot dog")
...
Same effect, except a vector allows the array to grow if needed.