Thread: whats wrong with the if statments

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Registered User eth0's Avatar
    Join Date
    Dec 2003
    Posts
    164
    Your returning the function main() to an integer???

    Listen to what alphaoide said, main will return 0.

    Also, you only need 1 include. <iostream> (drop the .h, they are depricieted)


    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
          int watdoyousee;
          cout <<"filler V0.1 unregistert version\n";
          cout <<"\n\n\n\n\n";
          cout <<"1.unpack\n";
          cout <<"2.pack\n";
          cin>>watdoyousee;
    
          if  (watdoyousee == 1)
          {
              cout <<"dombo\n\n";
          }
          else if (watdoyousee == 2)
          {
              cout <<"goedso\n\n";
          }
          else
          {
               cout << "Unknown option '" << watdoyousee << "'\n";
          }
          return 0;
    }
    Last edited by eth0; 01-14-2004 at 03:06 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM