Thread: string help
View Single Post
Old Feb 24th, 2005, 8:34 PM   #1
AlphaXero
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 AlphaXero is on a distinguished road
string help

alright i m a newbie at programming so this and any questions i ask here will more then likely be pretty easy for some of you. anyways, i m attempting to make a text based rpg just to see how things work, ya know just for fun. and i get a error "error: syntax error before string constant." what i am trying to do is be able to enter a word, or set of words and have it call a function, but i dont know what i m doing wrong. Here is my code (also i know you could figure this out, but i am working in C not C++)
start()
{
    char str
    printf ("you see a door what do you do?\n");
    scanf ("%s", str);
    if (str "door" == 0)
     {
       printf ("you get to the door");
     }
}
AlphaXero is offline   Reply With Quote