Hello!
I'm terribly confused about how to pass a simple integer that was read from my main() to another function (in the same file). I know this is a really silly issue, but searching on the internet is just making me more confused. Here's my code so far.
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <conio.h>
#include <windows.h>
using namespace std;
int zonePick(int);
int main()
{
string shipName;
int zone;
cout<<"Space Simuator v0.1"<<endl;
Sleep(1000);
cout<<"Enter a name for your ship!"<<endl;
cin>>shipName;
cout<<"You are the captain of "<<shipName<<"!"<<endl;
Sleep(500);
cout<<"Your job is to guide the "<<shipName<<" through the perils of space!"<<endl;
cout<<"Choose where you want to go in the map?"<<endl;
Sleep(1000);
cout<<"1-Zone One"<<endl;
Sleep(500);
cout<<"2-Zone Two"<<endl;
Sleep(500);
cout<<"3-Zone Three"<<endl;
Sleep(500);
cout<<"4-Zone Four"<<endl;
cin>>zone;
zone=zonePick(zone);
}
int zonePick() {
}
Basically, I want to pass the variable "zone" into "int zonePick()", so that I can create if loops there to send to other functions that control the zones. That's besides the point right now. Any help would be appreciated. I know the code I have right now isn't perfect. Thanks much!