Thread: string help
View Single Post
Old Feb 24th, 2005, 8:54 PM   #2
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Well, the most obvious thing I see is that your str variable needs to be an array. There may be some other errors that I didn't catch at first glance, though, and if there are, let us know.

Edit: Ahh. Just found another one. Your if statement is incorrect. If you want to test for the word door, you need to do it like this:

 if(strcmp(str, "door") == 0)
 {
 	 // code
 }
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower

Last edited by Mjordan2nd; Feb 24th, 2005 at 8:56 PM.
Mjordan2nd is offline   Reply With Quote