identifier not found

Joined
Oct 1, 2007
Messages
1
Reaction score
0
i super new to c++ and i'm taking the second semester course, which i never took the first, so it's kinda hard for me with the syntax and all. here's my issue:

int getMenuOption()
{
int menuOption;

cout << "Please make a selection:" << endl;
cout << "1. Enter information for a plane." << endl;
cout << "2. View information for a plane." << endl;
cout << "3. Exit the program." << endl;

menuOption = getValidInt("Enter the menu option: "); // <-- 'getValidInt': identifier not found
return menuOption;
}

int getValidInt(char *prompt)
{ // <-- 'getValidInt' : redefinition; previous definition was 'formerly unknown identifier'
const int MAX = 80;
char buffer[MAX];
int i;
cout << prompt;
cin.getline(buffer, MAX);

while (strlen(buffer) != strspn(buffer, "1234567890"))
{
cout << "Invalid integer - please re-enter: ";
cin.getline(buffer, MAX);
}

i = atoi(buffer);
return i;
}

i hope this is all the code needed to figure it out. thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top