C++ Starting up different files in if/else if
<pre><code>class Introduction
{
public:
Introduction() 
{
    repeat = false;
  //  Items("/Users/ewokhugz/Documents/Apps/Space Adventure/Space Adventure/CargoItems.txt");
}
~Introduction() {}
void intro_Init();

private:
std::string anyInput();
void invalid();
bool repeat;
};
</code></pre>

<p>That is my Introduction.h file</p>

<p>This is my Introduction.cpp file.</p>

<pre><code> using namespace std;
 void Introduction::intro_Init () {

//Errors err;

cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "*            Jay: Hey Kid?             *" &lt;&lt; endl;
cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "1. Yes? \n2. Ignore" &lt;&lt; endl;
string yesOrNo;
cin &gt;&gt; yesOrNo;
if (yesOrNo == "1") {
    //NEED TO INITIATE THE STARTGAME::GAME_INIT()

}
else if (yesOrNo == "2") {
   //NEED TO INITIATE ZERTH
//        Zerth zerthstart;
//        zerthstart.zerth_Init();
}
}
</code></pre>

<p>I want it so if the user enters 1 then it links to "StartGame.cpp"
and if the user enters 2 then it links to the file "Zerth.cpp"
I've tried everything, and if I run as. If I enter 1 or 2 it'll auto link me to StartGame.cpp.
Many thanks.
<strong>EDIT</strong>
My Intro.h
    class Introduction
    {
    public:
    Introduction() 
       {
        repeat = false;
      //  Items("/Users/ewokhugz/Documents/Apps/Space Adventure/Space Adventure/CargoItems.txt");
    }
    ~Introduction() {}
    void intro_Init();</p>

<pre><code>private:
std::string anyInput();
void invalid();
bool repeat;
</code></pre>

<p>};</p>

<p>My Intro.cpp</p>

<pre><code>#include "Intro.h"
#include "StartGame.h"
#include "Zerth.h"
 using namespace std;
void Introduction::intro_Init () {


using std::cout;
using std::endl;
using std::string;

//Errors err;

cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "*            Jay: Hey Kid?             *" &lt;&lt; endl;
cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "1. Yes? \n2. Ignore" &lt;&lt; endl;
string yesOrNo;
cin &gt;&gt; yesOrNo;
if (yesOrNo == "1") {
    //NEED TO INITIATE THE STARTGAME::GAME_INIT()
    StartGame gamestart;
    gamestart.game_Init();

}
else if (yesOrNo == "2") {
   //NEED TO INITIATE ZERTH
    Zerth zerthstart;
    zerthstart.zerth_Init();
}
}
</code></pre>

<p>Zerth.h</p>

<pre><code>class Zerth
{
public:
Zerth() 
{
    repeat = false;
    //  Items("/Users/ewokhugz/Documents/Apps/Space Adventure/Space Adventure/CargoItems.txt");
}
~Zerth() {}
void zerth_Init();

private:
std::string anyInput();
void invalid();
bool repeat;
};
</code></pre>

<p>Zerth.cpp</p>

<pre><code>#include &lt;iostream&gt;
#include "Zerth.h"
#include "Intro.h"
using namespace std;
void Zerth::zerth_Init () {


cout &lt;&lt;"You are in Zerth" &lt;&lt; endl;
repeat = true;
}
</code></pre>

<p>StartGame.h</p>

<pre><code>class StartGame
{
public:
StartGame() 
{
    repeat = false;
   // Items("/Users/ewokhugz/Documents/Apps/Space Adventure/Space   Adventure/CargoItems.txt");
}
~StartGame() {}
void game_Init();

private:
std::string anyInput();
void invalid();
bool repeat;
</code></pre>

<p>};</p>

<p>StartGame.cpp</p>

<pre><code>#include "StartGame.h"
#include "Intro.h"
using namespace std;
void StartGame::game_Init() {
cout &lt;&lt; "* Well you've come to the right place. *" &lt;&lt; endl;
cout &lt;&lt; "* I have a cargo filled with that needs*" &lt;&lt; endl;
cout &lt;&lt; "* to be shipped.                       *" &lt;&lt; endl;
cout &lt;&lt; "* Keep in mind that this isn't exactly *" &lt;&lt; endl;
cout &lt;&lt; "* ... legal bussiness. So keep it quiet*" &lt;&lt; endl;
cout &lt;&lt; "*   *" &lt;&lt; endl;
cout &lt;&lt; "* to tell you exactly how I found you. *" &lt;&lt; endl;
cout &lt;&lt; "* Simply put, I found you under a pile *" &lt;&lt; endl;
cout &lt;&lt; "* of debris. You were unconcious for   *" &lt;&lt; endl;
cout &lt;&lt; "* seven or eight weeks after I found   *" &lt;&lt; endl;
cout &lt;&lt; "* you. Oh! How rude of me, I never     *" &lt;&lt; endl;
cout &lt;&lt; "* introduced myself. My name is Samuel.*" &lt;&lt; endl;
cout &lt;&lt; "* This, is my laboratory. I assume that*" &lt;&lt; endl;
cout &lt;&lt; "* you may have been an assistant of the*" &lt;&lt; endl;
cout &lt;&lt; "* previous professors? I'll have to    *" &lt;&lt; endl;
cout &lt;&lt; "* inquire about the accident later. I  *" &lt;&lt; endl;
cout &lt;&lt; "* didn't quite catch your name, by the *" &lt;&lt; endl;
cout &lt;&lt; "* way. Also, just to clear some things *" &lt;&lt; endl;
cout &lt;&lt; "* up... I never quite caught your sex, *" &lt;&lt; endl;
cout &lt;&lt; "* considering your face is caked in a  *" &lt;&lt; endl;
cout &lt;&lt; "* layer of dust. No offense, I'd rather*" &lt;&lt; endl;
cout &lt;&lt; "* know however, if you'd be so kind.   *" &lt;&lt; endl;
cout &lt;&lt; "****************************************\n\n" &lt;&lt; endl;

std::string gender;
repeat = true;
while (repeat == true)
{
    cout &lt;&lt; "Gender: " &lt;&lt; endl;
    cout &lt;&lt; "1. Boy. " &lt;&lt; endl;
    cout &lt;&lt; "2. Girl. " &lt;&lt; endl;

    gender = anyInput();

    if (gender == "1")
    {
        gender = "BOY";
        repeat = false;
        break;
    }
    if (gender == "2" or "girl")
    {
        gender = "GIRL";
        repeat = false;
        break;
    }
    if (gender == "?")
    {
        gender = "HERM";
        repeat = false;
        break;
    }
    if (gender != "?" &amp;&amp; gender != "2" &amp;&amp; gender != "1")
    {
        invalid();
    }
}

cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "* So you're a " &lt;&lt; gender &lt;&lt; "!" &lt;&lt; endl;
cout &lt;&lt; "* So, what was your name?              *" &lt;&lt; endl;
cout &lt;&lt; "****************************************\n\n" &lt;&lt; endl;
std::string name;

cout &lt;&lt; "What is your name?" &lt;&lt; endl;
name = anyInput();

cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "* Ahh! So your name is " &lt;&lt; name &lt;&lt; "!" &lt;&lt; endl;
cout &lt;&lt; "****************************************\n" &lt;&lt; endl;

cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "* Let me explain what happened in the  *" &lt;&lt; endl;
cout &lt;&lt; "* lab while you were out. First and    *" &lt;&lt; endl;
cout &lt;&lt; "* foremost, I have taken over. I am    *" &lt;&lt; endl;
cout &lt;&lt; "* your new boss. I'd like for you to   *" &lt;&lt; endl;
cout &lt;&lt; "* know that the task I have for you is *" &lt;&lt; endl;
cout &lt;&lt; "* completely unrelated to the reason   *" &lt;&lt; endl;
cout &lt;&lt; "* that you signed up for your current  *" &lt;&lt; endl;
cout &lt;&lt; "* position. In the accident, a rare,   *" &lt;&lt; endl;
cout &lt;&lt; "* unstable compound combined with an   *" &lt;&lt; endl;
cout &lt;&lt; "* unknown element. In the process of   *" &lt;&lt; endl;
cout &lt;&lt; "* destroying this entire laboratory,   *" &lt;&lt; endl;
cout &lt;&lt; "* it has done some interesting things. *" &lt;&lt; endl;
cout &lt;&lt; "* Come see me tomorrow and I will      *" &lt;&lt; endl;
cout &lt;&lt; "* explain some more to you.            *" &lt;&lt; endl;
cout &lt;&lt; "****************************************" &lt;&lt; endl;
repeat = false;
//    Player P(name, gender);
//    Pallet_Town pallet;
//    pallet.buildings(true);
}


std::string StartGame::anyInput()
{
using std::string;
using std::cin;

string input;
cin &gt;&gt; input;
return input;

}

void StartGame::invalid()
{
using std::cout;
using std::endl;
cout &lt;&lt; "****************************************" &lt;&lt; endl;
cout &lt;&lt; "*You did not input an acceptable value.*" &lt;&lt; endl;
cout &lt;&lt; "****************************************" &lt;&lt; endl;
repeat = true;
}
</code></pre>

<p>Ignore the bad story. But yeah here's the code.</p>
