Search found 2 matches

by cmatooooo
Sun Feb 11, 2018 11:53 am
Forum: ESP32 Arduino
Topic: arduino sizeof struct
Replies: 3
Views: 8444

Re: arduino sizeof struct

I found solution:

Code: Select all

typedef struct __attribute__((packed)) pokus_struct {
  unsigned char unsignedchar1;//1 byte
  float float1;          //4 bytes
} Pokus;
by cmatooooo
Sat Feb 10, 2018 10:19 pm
Forum: ESP32 Arduino
Topic: arduino sizeof struct
Replies: 3
Views: 8444

arduino sizeof struct

I need work with struct as with struct pointer in Arduino (ESP32 in Platformio). typedef struct pokus_struct { unsigned char unsignedchar1;//1 byte float float1; //4 bytes } Pokus; Pokus pokus; pokus.unsignedchar1=1; pokus.float1=2; Serial.println(sizeof(pokus)); // return to terminal 8 Serial.write...