| 1 | #include <stdio.h> |
|---|---|
| 2 | #include <stdint.h> |
| 3 | |
| 4 | template <size_t T> struct [[gnu::packed]] Payload { |
| 5 | uint8_t data[T]; |
| 6 | }; |
| 7 | |
| 8 | using ThreeBytes = Payload<3>; |
| 9 | using FiveBytes = Payload<5>; |
| 10 | using SixBytes = Payload<5>; |
| 11 | using SevenBytes = Payload<7>; |
| 12 | using NineBytes = Payload<9>; |
| 13 | |
| 14 | int main (int argc, char const *argv[]) |
| 15 | { |
| 16 | const char* stringdata = "hello world; I like to write text in const char pointers"; |
| 17 | uint8_t bytedata[] = {0xAA,0xBB,0xCC,0xDD,0xEE,0xFF,0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99}; |
| 18 | ThreeBytes b1; |
| 19 | FiveBytes b2; |
| 20 | SixBytes b3; |
| 21 | SevenBytes b4; |
| 22 | NineBytes b5; |
| 23 | return 0; // break here |
| 24 | } |
| 25 |
