Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char data[17] = { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','\0' }; // 16 zeroes + null terminator
- strcpy( data, "abcdefgh"); // 8 chars written to data[0] - data[7]
- strcpy( &data[8], "AA"); // 2 chars written to data[8] - data[9]
- int foo = sizeof(f.data); // 17
- int bar = foo / sizeof(int); // 8
- Serial.print(bar) // abcdefghAA
- // Why bar == 8 ? it should be 10!
Advertisement
Add Comment
Please, Sign In to add comment