Warning: sizeof(): Parameter must be an array or an object that implements Countable in /homepages/9/d213665487/htdocs/clickandbuilds/CoalGeology/wp-content/plugins/wordpress-firewall.php on line 245

Warning: sizeof(): Parameter must be an array or an object that implements Countable in /homepages/9/d213665487/htdocs/clickandbuilds/CoalGeology/wp-content/plugins/wordpress-firewall.php on line 245

Warning: Cannot modify header information - headers already sent by (output started at /homepages/9/d213665487/htdocs/clickandbuilds/CoalGeology/wp-content/plugins/wordpress-firewall.php:245) in /homepages/9/d213665487/htdocs/clickandbuilds/CoalGeology/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 62
Variable types and size requirement in C with Example Code – Coal Geology and Mining: Consulting Services

Variable types and size requirement in C with Example Code

// Variable types and size requirement in C
// this program illustrates how to figure out size requirement for a number of variable types in C

#include <stdio.h>
int main(void){
signed char sister;
short romance;
int age;
long life;
long long dino;

printf(“The size of signed char is %d\n”, sizeof(sister));
printf(“The size of short is %d\n”, sizeof(romance));
printf(“The size of int is %d\n”, sizeof(age));
printf(“The size of long is %d\n”, sizeof(life));
printf(“The size of long long is %d\n”, sizeof(dino));
}

 

OutputVarible types and size requirement in C_Image

Leave a Comment

Your email address will not be published. Required fields are marked *