mikeage.net Logo
mikeage.net/2006/10/03/

mikeage.net @ ח׳ טבת תשע״ט

Archive for ‍‍י״ב תשרי תשס״ז - October 3rd, 2006

Creating an array of strings for an enum

‍‍י״ב תשרי תשס״ז - Tuesday, October 3rd, 2006

A common issue in writing C based test tools is the desire to be able to show a user a list of all enums. This, of course, is technically impossible, as the mapping from enum to int is one way only. However, the following trick lets you create a two dimensional character array who's index is the enum (cast to int, to be pedantic) is an index to a string containing the name of the enum.
(more…)

Quick Map
Content +
Personal +
Archives +
Site Stuff +
RBS Weather +
Search +
Recent Images

Valid XHTML 1.1!
Printer Friendly Page
 

Last Modified: September 04, 2006 @ 02:11 CST

Memory(TRUE): 2097152/2097152
Memory(FALSE): 3237968/3247920