Code:
main()
{
char *vwest = "west",*vnorth = "north", *veast="east", *vsouth = "south";
enum place { east=1, west=2, south=3, north=4};
enum place dir;
dir = east;
if( dir == east )
printf("Not able to move %s\n", veast);
}
The above program is the example of the enumerator data types that defines the enumerated data type about the direction, this enumerator data type is been used to with the help of if else condition. This are the user defined data types that are used to store similar type of data.
Bookmarks