i am just learning how to do classes, and i made this program, but when i try to compile, it gives me an "declaration terminated incorrectly". what am i doing wrong?
Code:#include <iostream.h> void public::sayhello() { cout<<"hello there!"; } void public::saygoodbye() { cout<<"goodbye!"; } int main() { int choice cout<<"choose one:"; cout<<"[1] hello"; cout<<"[2] goodbye"; cin>>choice; if(choice==1) { sayhello(); } if(choice==2) { saygoodbye(); } return 0; }



LinkBack URL
About LinkBacks


