1

I am trying to understand some C code in a legacy database. There are constructions there of the form:

enum {a=0,b,c,d};

What does this achieve ? In the manuals, I only see constructions of the form:

enum example{a=0,b,c,d} test1; and this I understand.

Thanks, Suresh

Emil Laine
  • 41,598
  • 9
  • 101
  • 157

1 Answers1

6

This defines a set of constants which may be used anywhere with the values

  • a = 0
  • b = 1
  • c = 2
  • d = 3

Since we worried less about type safety in legacy C applications, we don't need a specific type for this, or variables directly associated with it

James McLeod
  • 2,381
  • 1
  • 17
  • 19