Suppose I have a list of #define
s in a header file for an external library. These #define
s represent error codes returned from functions. I want to wri
You are correct. There's no way to recover preprocessor-defined identifiers at runtime (unless you can read the source, but that's cheating). You would be better off creating a constant array of the names and indexing it with the error code (with proper boundary checks of course) - it should be quite easy to write a script to generate it.