a fresh pair of eyes

This is a homework assignment but it is almost complete, I just can't figure out where it is messing up. It is a program that is supposed to allow the user to input data about their classes and then print on the screen all of the class info or just one specific classes info. The two error messages say

fatal error LNK1169: one or more multiply defined symbols found
and
error LNK2005: _main already defined in planner.obj

I am using Visual C++ 2005 Express Edition on a Windows machine if that helps.

Here is the code:

#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <time.h>
using namespace std;

const int MAXLENGTH = 100;
const int MAXCLASSES = 100;

struct Classes
{
char classnumber[MAXLENGTH];
char classname[MAXLENGTH];
char meetday[10];
char teachername[MAXLENGTH];
float starttime;
float endtime;
int studentnumber;
};

int main()
{
int NUMCLASSES;
int userChoice;
displayMenu:
cout <<"What would you like to do?"<<endl;
cout <<"1. Add new data"<<endl;
cout <<"2. Display classes"<<endl;
cout <<"3. Quit"<<endl;
cin>> userChoice;
if (userChoice == 1)
{
int iIndexA;
cout << "How many classes would you like to enter?" ; cin >> NUMCLASSES ;
Classes classes[MAXCLASSES];
for(iIndexA = 0; iIndexA < NUMCLASSES; iIndexA++)
{
cout << "Class #";
cin.getline (classes[iIndexA].classnumber,(MAXLENGTH)) ;
cout << "Class name: ";
cin.getline(classes[iIndexA].classname, (MAXLENGTH));
cout << "Teacher's name: ";
cin.getline(classes[iIndexA].teachername, (MAXLENGTH));
cout << "Meet day: ";
cin.getline(classes[iIndexA].meetday, (MAXLENGTH));
cout << "Start time: "; cin >> classes[iIndexA].starttime;
cout << "End time: "; cin >> classes[iIndexA].endtime;
cout << "Number of students: "; cin >> classes[iIndexA].studentnumber;
}
system("PAUSE");
goto displayMenu;
}

else if (userChoice == 2)
{
char displayChoice;
cout<<"Please enter the class number you would like to display or all: " << endl;
cin >>displayChoice;
if (displayChoice == 'all')
{
cout << "did all" << endl;
Classes classes[MAXCLASSES];
int iIndexB;
for(iIndexB = 0; iIndexB < NUMCLASSES; iIndexB++)
{
cout << endl;
cout << "Class #" << classes[iIndexB].classnumber << endl;
cout << "Class Name: " << classes[iIndexB].classname << endl;
cout << "Teacher's name: " << classes[iIndexB].teachername << endl;
cout << "Meet day: " << classes[iIndexB].meetday << endl;
cout << "Start time: " << classes[iIndexB].starttime;
cout << "End time: " << classes[iIndexB].endtime << endl;
cout << "Number of students: " << classes[iIndexB].studentnumber << endl;
}
}
else
cout << "class not all" << endl;
}
return 0;
}



I would appreciate any help. Thank you in advance.
I think you have 2 mains in the project folder. You might have 2 different .cpp files and I don't think you can have more than one main().
Topic archived. No new replies allowed.