# Print enumeration constant name?

**URL:** <https://forum.kirupa.com/t/print-enumeration-constant-name/278309>\
**Category:** Uncategorized\
**Created:** [December 26, 2008, 7:21pm UTC](https://forum.kirupa.com/t/print-enumeration-constant-name/278309 "2008-12-26T19:21:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![errcricket](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@errcricket](https://forum.kirupa.com/u/errcricket)\
**Post date:** [December 26, 2008, 7:21pm UTC](https://forum.kirupa.com/t/print-enumeration-constant-name/278309/1 "2008-12-26T19:21:28Z")

</div>

I am having some problems with enumerations. Lets say for example I have defined a new data type:

[COLOR=blue]

```auto
 enum

```

[/COLOR]

```auto
 Vehicle {SMART = 0, MINI = 1, MAZDA = 2, ACCORD = 3} ;

```

I know that I can assign each constant a value, and that if none is supplied, the compiler will assign the first constant a value of zero with each constant increasing by a value of 1. …what if I want to print the actual constant name? instead of 2, I want MAZDA instead? Is there a way to do this without strings?
