Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mkristain

macrumors regular
Original poster
Aug 18, 2011
115
0
Hello i have this error in my application.

Code:
//define this in abc header class
#define	XYZ_TEST

//and use struct in other test.c class
const struct types_test types_t[] = {
  { XYZ_TEST, 			"xyz test"		}//here error occured.
};

thanks.
 
Hello i have this error in my application.

Code:
//define this in abc header class
#define	XYZ_TEST

//and use struct in other test.c class
const struct types_test types_t[] = {
  { XYZ_TEST, 			"xyz test"		}//here error occured.
};

thanks.

So what does

#define XYZ_TEST

mean? Read up on the rules for macro evaluation. What happens exactly when XYZ_TEST is ued in your source code?
 
Since XYZ_TEST is defined to be blank, your code expands to
Code:
const struct types_test types_t[] = {
  { , "xyz test" }
};
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.