Thursday, January 26, 2012

Basic usage of enum in C++

#include<iostream>

using std::cout;
using std::endl;

int main(){
 cout << "http://dev-microsoft.blogspot.com/" << endl << endl;

 enum Day {SUN, MON, TUE, WED, THU, FRI, SAT};

 cout << SUN << endl;
 cout << MON << endl;
 cout << TUE << endl;
 cout << WED << endl;
 cout << THU << endl;
 cout << FRI << endl;
 cout << SAT << endl;

 cout << endl;
 system("PAUSE");
}

Basic usage of enum in C++


Compare to Basic usage of enum class in CLR C++

No comments:

Post a Comment