Sorry, still missing something...
Definately need my eyes checked...
Error:asstester.cpp(300,1):Declaration missing ;
Error:asstester.cpp(300,1):Compound statement missing }
Code:
void doModify()
{
clrscr();
char inputv, input1, input2;
cout << " " << endl;
cout << " --- MODIFY VIDEO MENU ---- " << endl;
cout << " Would you like to modify a video (y/n)?: ";
cin >> inputv;
if (inputv == 'y' || inputv == 'Y')
{
clrscr();
int item1, location1, location2;
char item2[20];
cout << " " << endl;
cout << " -- Current Record -- " << endl;
cout << " What is the Video Number?: ";
cin >> item1;
location1 = searchNum(videoLib, numElements, item1);
if (location1 == -1)
{
clrscr();
cout << " " << endl;
cout << " Invaild Input" <<endl;
cout << " Press any key to exit ....";
input1 = getch();
}
else
{
cout << " What is the Video Name?: ";
cin >> item2;
location2 = searchName(videoLib, numElements, item2);
if (location2 == -1)
{
clrscr();
cout << " " << endl;
cout << " Invaild Input" <<endl;
cout << " Press any key to exit ....";
input2 = getch();
}
else
{
cout << " " << endl;
cout << " -- New Record -- " << endl;
cout << " What is the Video Number?: ";
cin >> videoLib[location1].videoNum;
cout << " What is the Video Name?: ";
cin.getline(videoLib[location2].videoName, 30);
}
}
}
Re: Sorry, still missing something...
Quote:
Originally Posted by bradleyc
Definately need my eyes checked...
1) Get an editor that does brace matching. The Visual C++ editor, plus many third-party editors for Windows and Linux/UNIX exist that have this capability.
2) Organize your code so that it is easily detected that there are missing braces.
Code:
void doModify()
{
clrscr();
char inputv, input1, input2;
cout << " " << endl;
cout << " --- MODIFY VIDEO MENU ---- " << endl;
cout << " Would you like to modify a video (y/n)?: ";
cin >> inputv;
if (inputv == 'y' || inputv == 'Y')
{
clrscr();
int item1, location1, location2;
char item2[20];
cout << " " << endl;
cout << " -- Current Record -- " << endl;
cout << " What is the Video Number?: ";
cin >> item1;
location1 = searchNum(videoLib, numElements, item1);
if (location1 == -1)
{
clrscr();
cout << " " << endl;
cout << " Invaild Input" <<endl;
cout << " Press any key to exit ....";
input1 = getch();
}
else
{
cout << " What is the Video Name?: ";
cin >> item2;
location2 = searchName(videoLib, numElements, item2);
if (location2 == -1)
{
clrscr();
cout << " " << endl;
cout << " Invaild Input" <<endl;
cout << " Press any key to exit ....";
input2 = getch();
}
else
{
cout << " " << endl;
cout << " -- New Record -- " << endl;
cout << " What is the Video Number?: ";
cin >> videoLib[location1].videoNum;
cout << " What is the Video Name?: ";
cin.getline(videoLib[location2].videoName, 30);
}
}
}
} // <-- This is missing
You are missing the last ending brace.
Regards,
Paul McKenzie