pete wrote:
moose wrote:
Can someone explain why the following will not work,
#define MYSTRUCT(name,size) struct my_struct_ ## name {
unsigned char name ## _array[ size ] ;
} ;
You need two backslashes.
#define MYSTRUCT(name,size) struct my_struct_ ## name {\
unsigned char name ## _array[ size ] ;\
} ;
You might tell him why. #defines have to be complete on one line.
To write them on multiple lines you have to escape the line
endings, which means an escape char (the \) at the end of each
continued line. Nothing follows the escape except the eoln marker.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson