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
#include <iostream> //basic code
#include <thread> //sleep_for
#include <chrono> //seconds
#include <windows.h> //Windows Functions
#include <string> //string
#include "cmdTest.h"
usingnamespace 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.)