Originally Posted by
Jenica
comm keeps giving me 0, and I don't know why...
What input are you trying to enter at your "Command:" prompt?
Code:
int main()
{
int memory[64];
string command, s1, input, s2, space;
int eight, num1, num2, temp, comm;
// These two lines should not be here, they belong outside of the main function
int valid_location(int);
void get_numbers(string, string&, string&);
space = " ";
for (int i = 0; i < 64; i++)
{
memory[i] = -999;
}
cout << endl << "Command: ";
getline(cin,input);
command = input.substr(0,1);
comm = atoi(command.c_str());
cout << command << endl;
cout << comm;
return 0;
}