brintos

brintos / llvm-project-archived public Read only

0
0
Text · 628 B · 15c8df1 Raw
25 lines · cpp
1#include <stdio.h>2#include <stdint.h>3 4template <size_t T> struct [[gnu::packed]] Payload {5  uint8_t data[T];6};7 8using ThreeBytes = Payload<3>;9using FiveBytes = Payload<5>;10using SixBytes = Payload<5>;11using SevenBytes = Payload<7>;12using NineBytes = Payload<9>;13 14int 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 here24}25