View Single Post
  #1 (permalink)  
Old June 10th, 2005, 08:54 PM
ands122 ands122 is offline
Registered User
 
Join Date: Jun 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default small C++ game code PLEASE HELP!!!

 I have no experience with C++. this is my first program i've written. or at least tried to. I keep on getting this error.

Cannot specify -o with -c or -S an multiple compilations.



this is my code:



  #include <stdio.h>
  #include <iostream.h>
  #include <string.h>
  int main(int nNumberofArgs, char* pszArgs[])
  {
       //go to the market
       string smarket="go to the market";
       //explore
       string sexplore="explore";
       string schoice= ""
           cout << "You wake up from a sleep that you\n"
                << "can't remember... That's odd...\n"
                << "You find yourself next to a city.\n"
                << "You also see some money next to you.\n"
                << "Do you want to go to the market,\n"
                << "or explore? (type in either explore or go to market in exact words.)\n";
            cin >> schoice1;

                    switch(schoice1)
                    {
                            case smarket:
                      cout << "You walk into the market\n";
                            break;
                            case sexplore:
                      cout << "You explore. But of course,\n"
                      cout << "as you should've expected,\n"
                      cout << "you die. You don't know how,\n"
                      cout << "you just do.";
                            break;
                            default:
                      cout << "You didn't enter a valid command. Idiot.";
                     }
        return 0;
  }


by the way. I have C++ for dummies and i didn't even get half way through the book. I just want to make a simple game before I do. I don't know anything about the #include things or the return thing at the end. I was just wondering if anyone could help me.
Reply With Quote