Saturday, 14 September 2013

Comparing a single string to an array of strings in C

Comparing a single string to an array of strings in C

My program is accepting user input and then taking the first word inputted
and comparing it to an array of accepted commands. What would be the best
way to compare the first word inputted (after it has been tokenized) to an
array of strings?
Example:
comparing the string "pwd" to an array containging {"wait", "pwd", "cd",
"exit"}
Thanks in advance for your help!

No comments:

Post a Comment