Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8767573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:50:59+00:00 2026-06-13T16:50:59+00:00

I have what I’m sure is a simple problem, but I can’t figure it

  • 0

I have what I’m sure is a simple problem, but I can’t figure it out. In the code below, I’d like to be able to have case 5 re-display the options afterward. How can I do this? Thanks in advance!

// Input the race of your character
    cout << "Choose a race here: " << endl
    << "1) Human, 2) Elf, 3) Dark Dwarf, 4) Commoner, 5) Race info, 6) Admin Debug Race : ";

    cin >> mCharRace;

    switch (mCharRace)
        {
        case 1:
        cout << "You have chosen Human!" << endl;
        mExpPoints = 999;
        mArmor = mArmor + 2;
        break;
    case 2:
        cout << "You have chosen Elf!" << endl;
        mAccuracy = mAccuracy + 2;
        mWeapon.mDamageRange.mLow = mWeapon.mDamageRange.mLow + 1;
        break;
    case 3:
        cout << "You have chosen Dark Dwarf!" << endl;
        mWeapon.mDamageRange.mHigh = mWeapon.mDamageRange.mHigh + 2;
        mMaxHitPoints = mMaxHitPoints + 3;
        break;
    case 4:
        cout << "You have chosen Commoner! Brave man." << endl;
        mAccuracy       = mAccuracy - 3;
        mHitPoints      = mHitPoints - 5;
        mMaxHitPoints   = 8;
        mExpPoints      = -250;
        mNextLevelExp   = 1500;
        mArmor          = -1;
        break;
    case 5:
        cout << "Placeholder for explanation text." << endl;
        break;
    case 6:
        cout << "ADMIN POWERS UNITE!!!!!!!" << endl;
        mAccuracy       = 20;
        mHitPoints      = 1000;
        mMaxHitPoints   = 1000;
        mExpPoints      = 0;
        mNextLevelExp   = 1000;
        mArmor          = 100;
        mWeapon.mName   = "Admin Sword of HNNNG!";
        mWeapon.mDamageRange.mLow   = 100;
        mWeapon.mDamageRange.mHigh  = 150;
        mGold           = 1000000;
        break;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:51:01+00:00Added an answer on June 13, 2026 at 4:51 pm

    A switch-case construct isn’t an iteration construct. It can only select a certain case and execute it. The flow of control cannot go back up due to it.

    So, you can’t use it to loop.
    Wrap it in a while or for looping construct instead.

    while(condition){
       switch (mCharRace){
       ...
       ...
       }
    }
    

    Just turn condition to false when you want to stop looping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
have a php code like this,going to convert it in to C#. function isValid($n){
Have one Doubt In MVC Architecture we can able to pass data from Controller
I have two tables with like below codes: Table: Accounts id | username |
Have whats probably a simple problem with using parent in if and each statements
Have such a problem, hope you'll help me.. Can't find anywhere. Here is the
Have read a lot of articles, but can't make animate function to run indefinitely.
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Have a painfully simple blog Post creator, and I'm trying to check if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.