Skip to content

Instantly share code, notes, and snippets.

@choonewza
Last active January 26, 2020 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save choonewza/6eb05624317a0020460bd0ba4f699ee0 to your computer and use it in GitHub Desktop.
Save choonewza/6eb05624317a0020460bd0ba4f699ee0 to your computer and use it in GitHub Desktop.
Content CAT LoRa Lab13 - datatype size
void setup() {
Serial.begin(115200);
while(!Serial);
Serial.println("Size of Variable");
Serial.println();
Serial.println(String("char = ") + sizeof(char) + " Byte");
Serial.println(String("boolean = ") + sizeof(bool) + " Byte");
Serial.println(String("short int = ") + sizeof(short int) + " Byte");
Serial.println(String("long int = ") + sizeof(long int) + " Byte");
Serial.println(String("unsigned int = ") + sizeof(unsigned int) + " Byte");
Serial.println(String("int = ") + sizeof(int) + " Byte");
Serial.println(String("signed long int = ") + sizeof(signed long int) + " Byte");
Serial.println(String("unsigned long int = ") + sizeof(unsigned long int) + " Byte");
Serial.println(String("uint8_t = ") + sizeof(uint8_t) + " Byte");
Serial.println(String("uint16_t = ") + sizeof(uint16_t) + " Byte");
Serial.println(String("uint32_t = ") + sizeof(uint32_t) + " Byte");
Serial.println(String("uint64_t = ") + sizeof(uint64_t) + " Byte");
Serial.println(String("long = ") + sizeof(long) + " Byte");
Serial.println(String("unsigned long = ") + sizeof(unsigned long) + " Byte");
Serial.println(String("float = ") + sizeof(float) + " Byte");
Serial.println(String("double = ") + sizeof(double) + " Byte");
Serial.println(String("String = ") + sizeof(String) + " Byte");
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment