943,600 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1245
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 24th, 2008
1

Re: c++ game help

C++ Syntax (Toggle Plain Text)
  1. switch (choice)
  2. {
  3. case '1':
  4. saveGame();
  5. case '2':
  6. switch (missionNumber)
  7. {
  8. case 1:
  9. mission1();
  10. case 2:
  11. mission2();
  12. case 3:
  13. mission3();
  14. case 4:
  15. mission4();
  16. case 5:
  17. mission5();
  18. }
  19. case '3':
  20. statScreen();
  21. case '4':
  22. weaponBuy();
  23. case '5':
  24. if (respect != 100)
  25. {
  26. system("CLS");
  27. cout << "Sorry, you have to be 100 respect to use this feature" << endl;
  28. system("PAUSE");
  29. battleScreen();
  30. }
  31. else
  32. {
  33. kMafia();
  34. }
  35. case '6':
  36. enemyPeople();
  37. }
Remember that you need break statements to end each case . . . .
Reputation Points: 185
Solved Threads: 28
Posting Whiz in Training
dwks is offline Offline
269 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: error C2296
Next Thread in C++ Forum Timeline: Need Help with CCombobox MFC





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC