Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

C Variable Byte Sizes

#include <stdio.h>

int main(void) {
  printf("char size: %lu bytes
", sizeof(char));
  printf("int size: %lu bytes
", sizeof(int));
  printf("short size: %lu bytes
", sizeof(short));
  printf("long size: %lu bytes
", sizeof(long));
  printf("float size: %lu bytes
", sizeof(float));
  printf("double size: %lu bytes
", 
    sizeof(double));
  printf("long double size: %lu bytes
", 
    sizeof(long double));
}
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #C #Variable #Byte #Sizes
ADD COMMENT
Topic
Name
7+8 =