John Mavrick's Garden

Search IconIcon to open search

Last updated Unknown

Status: Tags: Links: C Enum


C Enum

Examples

Declaration and usage

1
2
3
4
5
6
enum suit {Hearts, Spades, Clubs, Diamonds}; // default values are assigned starting from 0  
 // i.e., Hearts = 0, Spades = 1, Clubs = 2, Diamonds = 3;

 enum emphasis {Bold = 1, Italic = 2, Underline = 4}; // can define integer values of the names

Usage:  enum sui card = Spades; // variable of type enum suit

Backlinks

1
list from C Enum AND !outgoing(C Enum)

References:

Created:: 2021-09-22 14:40


Interactive Graph