Enum Scope - C Data Type

C examples for Data Type:enum

Introduction

An enum can be declared globally or locally within a function.

Demo Code

/* Global enum */
enum speed { SLOW, NORMAL, FAST };

int main(void) {
  /* Local enum */
  enum color { RED, GREEN, BLUE };
}

Related Tutorials