variably modified ‘_memory’ at file scope

[ad_1]

variably modified ‘_memory’ at file scope
//test.h
static const int size = 10;
#define GOOD_SIZE 10 // GOOD_SIZE will be replace by 10 during the compilation

typedef struct titi_s {
 	char toto[size]; 		// can't compile because size is a int and you can't have static array with value of variable size
  	char tutu[GOOD_SIZE]; 	// can compile because GOOD_SIZE is not an int
} titi_t;

[ad_2]

Content Protection by DMCA.com
Please Share