Hi, I'm trying to write a program using enum to store data. The user needs to input the first two letters of a word and the program outputs the full word. Here is what I have, but for some reason I cannot get it to run (visual c++ express edition).
#include <iostream>
using namespace std;
enum courses {ALGEBRA, ANALYSIS, BASIC};
int main()
courses readCourses()
{
courses registered;
char ch1, ch2;
cout << "Enter the first two letters of the course: "
<< endl;
cin >> ch1 >> ch2;
switch (ch1)
{
case 'a':
case 'A':
if (ch2 == '1' || ch2 == 'L')
registered = ALGEBRA;
else
registered = ANALYSIS;
break;
case 'b':
case 'B':
registered = BASIC;
break;
default:
cout << "Illegal input. " << endl;
}
return registered;
}
here are the errors im getting:
error C3646: 'courses' : unknown override specifier
error C3646: 'readCourses' : unknown override specifier
error C2091: function returns function
error C2440: 'return' : cannot convert from 'courses' to 'int (__cdecl *)(void)'
This program isn't what I want my final program, but I'm just trying to see if I can get this to work before I put it all the extra stuff. Thanks!