Raised This Month: $ Target: $400
 0% 

C++ help..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 04-20-2007 , 21:44   Re: C++ help..
Reply With Quote #3

Here ill just edit this, sorry for double post but whatever

PHP Code:
#include <iostream>

using namespace std;

void ShowFirstOption();
void ShowSecondOption();
void ShowThirdOption();

int main()
{

    
int choice;

    
cout << "\tThis is a menu to pick choices" << endl;
            
cout << "1: This is option 1" << endl;
            
cout << "2: This is option 2" << endl;
            
cout << "3: This is option 3" << endl;
            
cout << "0: Exit" << endl;

    
cin >> choice;

    
/*if( choice < 0 || choice > 3 ) // dont really need to check this because the default case will handle it
    {
        exit(0);
    }
    else
    {*/

    
switch(choice)
    {
        case 
1ShowFirstOption();
        break;
        
        case 
2ShowSecondOption();
        break;
        
        case 
3ShowThirdOption();
        break;

        default: exit(
0);
        break;
    }
    }

    return 
0;
}

void ShowFirstOption()
{
    
cout << "This is the first option" << endl;
}

void ShowSecondOption()
{
    
cout << "This is the second option" << endl;
}

void ShowThirdOption()
{
    
cout << "This is the third option" << endl;

__________________
It is stupid to be stupid, and stupid to not be stupid
LittleDude is offline
Send a message via AIM to LittleDude
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode