I am not sure if this is a typo or something I simply do not understand....but it is probably the latter. Anyway, here is the setup.
The text explains the use of the merging operator "##"
NOTE...although the text uses printf, I believe the same principles apply to NSLog
A small test program produces an error.
The preprocessed code shows this:
My question.
Is the code usable as is, or did the publisher omit the "0" from the define, as in "Ox ## n .
thank you in advance
The text explains the use of the merging operator "##"
NOTE...although the text uses printf, I believe the same principles apply to NSLog
Code:
#define printx(n) printf( "%i\n", x ## n) )
A small test program produces an error.
Code:
#include <stdio.h>
#define printx(n) printf( "%i\n", x ## n)
int main (int argc, const char * argv[]) {
printx(FF);
return 0;
}
error: 'xFF' undeclared (first use in this function)
The preprocessed code shows this:
Code:
printf( "%i\n", xFF);
My question.
Is the code usable as is, or did the publisher omit the "0" from the define, as in "Ox ## n .
thank you in advance