diff options
| author | liuxueli <[email protected]> | 2024-08-05 10:04:16 +0000 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2024-08-05 10:04:16 +0000 |
| commit | 97107b1b0a5bfbd7206a345f1a123aa019bf696d (patch) | |
| tree | b712f7f2889f3a88bdb4e3f2fb99bb1e375b2372 /perf/perfect.cpp | |
| parent | e7ddd60836a10300fd5dfa2670c8f5c14c5ec718 (diff) | |
Feature: SSL Decoder create version
Diffstat (limited to 'perf/perfect.cpp')
| -rw-r--r-- | perf/perfect.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/perf/perfect.cpp b/perf/perfect.cpp new file mode 100644 index 0000000..6d1eeb0 --- /dev/null +++ b/perf/perfect.cpp @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <stdint.h> + +struct test_unit +{ + union + { + uint8_t u8; + uint16_t u16; + uint32_t u32; + size_t u64; + }; + + uint8_t *value; +}; + + +int main(void) +{ + struct test_unit unit={0}; + printf("sizeof(a) = %lu\n", sizeof(unit.u8)); + printf("sizeof(b) = %lu\n", sizeof(unit.u16)); + printf("sizeof(c) = %lu\n", sizeof(unit.u32)); + printf("sizeof(test_unit) = %lu\n", sizeof(struct test_unit)); + + return 0; +}
\ No newline at end of file |
