how to get #define symbol rather than value from predefine constants
<p>I have one C++ define statement as:</p>

<pre><code>#define PING 10
</code></pre>

<p>In my <code>main</code> function, I have something like:</p>

<pre><code>int main()
{
    int code;
    cout&lt;&lt;"enter command code";
    cin&gt;&gt;code;      // value entered 10
    cout&lt;&lt;code;   //here i want "PING" output instead of 10

    return 0;
}
</code></pre>

<p>How can I replace 10 with PING in my output?</p>

<h3>Edit:</h3>

<p>i will have multiple #define as</p>

<pre><code>#define PING 10
#define STATUS 20
#define FETCH 74
#define ACK 12
#define TRAIL 9
#define EXIT 198
</code></pre>

<p>now my bussiness logic will get only command code i.e 10 or 12 etc etc</p>

<p>i want to retreive corresponding command name for that code..how is it possible??</p>
