[Programming Language]
C/C++
[Question]
How do you convert a value defined in a macro into a string?
The code above should give an output of "666".Code:#define I_AM_NOT_A_STRING 666 ... printf("%s\n",I_AM_NOT_A_STRING );
[Programming Language]
C/C++
[Question]
How do you convert a value defined in a macro into a string?
The code above should give an output of "666".Code:#define I_AM_NOT_A_STRING 666 ... printf("%s\n",I_AM_NOT_A_STRING );
Change the format code %s to %d. [Hopeful guess!] haha
#define I_AM_NOT_A_STRING "666"
Maybe?![]()
correct ka hehehe sayop man diay ako question
sige ako iupdate ang question
[Question]
given the following macro definitions, I want to create a new macro named VERSION. This VERSION macro should be equal to "1.0.2" where the 1, 0 and 2 are the variables defined by MAJOR_V, MINOR_V and REVISION_V respectively.
no hardcoding of values should be doneCode:#define MAJOR_V 1 #define MINOR_V 0 #define REVISION_V 2 //#define VERSION //how can I combine the above 3 to form a string of the format "MAJOR_V.MINOR_V.REVISION_V"
w00t! post pa mo og daghan guys! Maka engganyo ni og programming da.![]()
Similar Threads |
|