int main()
{
Appointment appt;
int i;
string *description;
int *day, *month, *hour, *min, *_hour, *_min;
char chr, chr1, chr2, chr3;
string *command;
command = new string [sizeOfArray];
int sizeOfArray;
cin >> sizeOfArray;
for(i= 0; i< sizeOfArray; i++){
cin >> command[i];
if (command[i] == "cancel"){ // <---- ERROR OCCURS HERE
appt.cancel(i,description,day,month,hour,min,_hour,_min,chr,chr1);}
if (command[i] == "select"){
appt.select(i,chr,chr1);}
if (command[i] == "move to"){
appt.moveTo(i,chr,chr1,chr2,chr3,description);}
if (command[i] == "add"){
appt.add(i,chr,chr1,chr2,chr3,command,description,day,month,hour,min,_hour,_min);}
if (command[i] == "quit"){
break; }
if (command[i] == "list"){
appt.list(i,chr,chr1,chr2,chr3,command,description,day,month,hour,min,_hour,_min);}
}
system("PAUSE");
}
this is my main function,
the if statement is to check the command, and call the corresponding function,
the code compile happily, but the program just terminate abnormally after i enter the command.