RSS Forums RSS
Please support our C++ advertiser: Programming Forums

enum range

Join Date: Oct 2004
Location: India
Posts: 47
Reputation: aminura is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
aminura aminura is offline Offline
Light Poster

enum range

  #1  
Sep 24th, 2005
#include<iostream.h>
int main()
{
	enum flag{ x=1,y=2,z=4,e=8};
	flag f2=flag(99); // out of range
	return 0;
}

In this code the range of flag is 0:15 but it still compiles when 99 is entered which is out of range!!
Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming --WOW -- " What a ride!!! " -James Fineous McBride
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:43 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC