2 .cpp files not correspoding

So, I'm trying to make a cmd for a little project. It's really just a fun thing I'm doing. Anyways, I'm trying to call the function run(); in my main.cpp file, but the actual function is in cmdTest.cpp. I have a cmdTest.h file that says
1
2
3
4
5
6
#ifndef CMDTEST_H_INCLUDED
#define CMDTEST_H_INCLUDED

void run();

#endif // CMDTEST_H_INCLUDED 

and my code in main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>       //basic code
#include <thread>         //sleep_for
#include <chrono>         //seconds
#include <windows.h>      //Windows Functions
#include <string>         //string
#include "cmdTest.h"

using namespace std;


int main() {

    int y;
	cout << "Welcome: ";
	//getline(cin, y); CIN stops getting input on a SPACE GETLINE looks for it all
    cin >> y;
	switch(y) {
        case 1:
        run();
        break;
	}
}

and in cmdTest.cpp
1
2
3
4
5
6
7
8
9
10
11
void run () {
    if (input == "Readme") {cout << readme << endl; start();}
        if (input == "VapeNation") {cout << VapeNation << endl; start();}
            if (input == "Egg") {cout << Egg << endl; start();}
                if (input == "Umbrella") {cout << Umbrella << endl; start();}
                    if (input == "Shutdown") {shutdown();}
                        if (input == "logOut") {logOut();}
                            if (input == "Reboot") {cout << reboot();}
                                if (input == "FlipACoin") {FAC(); start();}
                                    if (input == "Bank") {bank(); start();}
}

but whenever I run the program I just get return(0); after inputing 1. (There is more to cmdTest.cpp but it is fairly long so I just put this part in. I have run the cmdTest.cpp file alone before and it works fine.)
Last edited on
Where is the variable declaration for 'input'?
@sakurasouBusters it is in cmdTesting.cpp
Where is cmdTesting.cpp?
@SakurasouBusters in the same project folder as main.cpp and cmdTesting.h.
Can you tell me where is the variable declaration for 'input' in this thread?
@SakurasouBusters sorry for the late response, and.... god damnit I'm dumb thanks for saying that I've fixed it. Really thankyou :)
Last edited on
Topic archived. No new replies allowed.