Posted By: Dark_samurai
sizeof() treats static arrays as pointers - 01/20/14 21:49
Hi JCL,
I just noticed the following behavior:
The seconds sizeof() statemant should return 40. Or am I wrong?
I just noticed the following behavior:
Code:
#include <acknex.h> short test; short array[20]; typedef struct TESTSTRUCT { short array[20]; }TESTSTRUCT; TESTSTRUCT teststruct; void main() { error(str_for_num( NULL, sizeof(test) ) ); // 2 -> OK error(str_for_num( NULL, sizeof(array) ) ); // 4 -> NOK error(str_for_num( NULL, sizeof(teststruct) ) ); // 40 -> OK }
The seconds sizeof() statemant should return 40. Or am I wrong?