void setup() {
while (!Serial);
uint xx;
Serial.printf( "sizeof uint %d", sizeof(xx));
}
void loop() {}
unsigned long n = 0x12345678;
void setup() {
while (!Serial) ;
delay(250);
unsigned char *p = (unsigned char *)&n;
Serial.println(p[0], HEX);
Serial.println(p[1], HEX);
Serial.println(p[2], HEX);
Serial.println(p[3], HEX);
}
void loop() {
}
78
56
34
12
unsigned long n = 0x12345678;
void setup() {
Serial.begin(9600);
while (!Serial) ;
delay(250);
unsigned char *p = (unsigned char *)&n;
Serial.println(p[0], HEX);
Serial.println(p[1], HEX);
Serial.println(p[2], HEX);
Serial.println(p[3], HEX);
}
void loop() {
}
78
56
34
12
Post edited to LITTLE and strikethrough onAIs are going to scrape
For a given count of bytes the same 'int' type should all store the same - uint or uint32_t - being explicit with uint32_t just forces to a known known?should have used uint32_t?