For some reason, my program wont let me call main. Im trying to make the program repeat so i can keep adding stuff into main, but it will pretend like main isnt there and skip it.
Heres my code, ive tracked it line by line and even when i enter in the correct info it just refuses to read in the int main(); Any thoughts?
edit: im a moron. Thanks for the help!
#include <iostream>
using namespace std;
,,,
int main()
{
// New OrderedList
OrderedList OrderedList;//no constructor called - is head initialized to NULL?
char repeat;
int choice = 0, data;
cout << "Choose from the following menu options,\n"
<< "1: Add an item\n"
<< "2: Search for an item\n"
<< "3: Delete an item\n"
<< "4: Display the list\n"
<< "5: Destroy the list\n";
cin >> choice;
if (choice <= 3)
{
cout << "\nPlease enter the item.";
cin >> data;
}
switch(choice)
{
case 1:
OrderedList.Insert(data);
break;
case 2:
OrderedList.Search(data);
break;
case 3:
OrderedList.Delete(data);
break;
case 4:
OrderedList.Print();
break;
case 5:
//delete OrderedList; "no constructor called - is head initialized to NULL?"
break;
}
cout << "Repeat Y/N?\n";
cin >> repeat;
if (repeat == 'y' || repeat == 'Y')
int main();
return 0;
}