Differences
This shows you the differences between two versions of the page.
sizeof [2013/06/20 09:00] |
sizeof [2021/04/05 11:23] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Size Of ====== | ||
+ | Prints the size of variables on the standard out. | ||
+ | < | ||
+ | #include < | ||
+ | #define PTRINT_SHORT | ||
+ | #ifdef PTRINT_SHORT | ||
+ | typedef short ptrint; | ||
+ | #endif | ||
+ | #ifdef PTRINT_INT | ||
+ | typedef int ptrint; | ||
+ | #endif | ||
+ | #ifdef PTRINT_LONG | ||
+ | typedef long ptrint; | ||
+ | #endif | ||
+ | #ifdef PTRINT_LONGLONG | ||
+ | typedef long long ptrint; | ||
+ | #endif | ||
+ | |||
+ | int main(void) { | ||
+ | if (sizeof(ptrint) != sizeof(void*)) { | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | printf (" | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | /* rest of your code here */ | ||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | {{tag> |