??? 01/05/05 08:43 Read: times |
#84352 - sizeof? Responding to: ???'s previous message |
a=sizeof(int)
typedef struct { short a, Byte b, char[5] c } alpha x=sizeof(alpha); int j; return sizeof(j); These are actually more of "compiler macros" than functions, the compiler just determines the size of given variable and compiles the value into the binary. note x won't be 8 bytes, but, say, 5 (with 16bit addressing) because c is a pointer, not the actual array. Thus, this is quite problematic with determining an array size. (of course if the array contains a null-terminated string it's best to use strlen() from <string.h>) |
Topic | Author | Date |
identifying the length of a variable | 01/01/70 00:00 | |
solution | 01/01/70 00:00 | |
Solution? | 01/01/70 00:00 | |
sizeof?![]() | 01/01/70 00:00 |