Results 1 to 3 of 3

Thread: What's wrong?

  1. #1
    NOMADMAN
    Guest

    What's wrong?

    Code:
    void MakeChoice(int choice)
    {
    	switch (choice)
    	{
    	case: 1
    		cout << "An excellent seafood choice\n\n";
    		break;
    	case: 2
    		cout << "An excellent seafood choice\n\n";
    		break;
    	case: 3
    		cout << "A Thanksgiving feast\n\n";
    		break;
    	case: 4
    		cout << "World's best burger\n\n";
    		break;
    	case: 5
    		cout << "Top grade sirloin - the best!\n\n";
    		break;
    	case: 6
    		cout << "Grains, nuts, and lots of veggies!\n\n";
    		break;
    	default:
    		cout << "Unknown menu option\n\n";
    		break;
    	}
    }
    Anyone?

    NOMAD

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Re: What's wrong?

    Code:
    void MakeChoice(int choice)
    {
    	switch (choice)
    	{
    	case 1:
    		cout << "An excellent seafood choice\n\n";
    		break;
    	case 2:
    		cout << "An excellent seafood choice\n\n";
    		break;
    	case 3:
    		cout << "A Thanksgiving feast\n\n";
    		break;
    	case 4:
    		cout << "World's best burger\n\n";
    		break;
    	case 5:
    		cout << "Top grade sirloin - the best!\n\n";
    		break;
    	case 6:
    		cout << "Grains, nuts, and lots of veggies!\n\n";
    		break;
    	default:
    		cout << "Unknown menu option\n\n";
    		break;
    	}
    }
    You had the colons in the wrong places.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    NOMADMAN
    Guest
    Thaks, I'm an idoit
    I think is should delete the post so as to cover up my retard-dom!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width