Quote Originally Posted by basanta View Post
The fun thing is my compiler printed emocion like (), where (hourly/monthly/weekly) was supposed to print.
Nope, you won't get the program to print one of the strings "hourly", "monthly" or "weekly" unless you tell it to.

An enum will internally be an integer, so everytime you write in your code hourly it will be replaced by 0, weekly by 1, etc. To print out the key, you need to switch again:
Code:
void print_period(period p) {
  switch(p) {
  case hourly: cout << "hourly"; break;
  case weekly: cout << "weekly"; break; 
  case monthly: cout << "monthly"; break;
  default: cout << "unknown";
  }
}