Search
 
SCRIPT & CODE EXAMPLE
 

C

how to print sizes of various data types of C

#include <stdio.h>
#include <conio.h>
int main(void)
{
	clrscr();
	printf("    short int is %2d bytes 
", sizeof(short int));
	printf("          int is %2d bytes 
", sizeof(int));
	printf("        int * is %2d bytes 
", sizeof(int *));
	printf("     long int is %2d bytes 
", sizeof(long int));
	printf("   long int * is %2d bytes 
", sizeof(long int *));
	printf("   signed int is %2d bytes 
", sizeof(signed int));
	printf(" unsigned int is %2d bytes 
", sizeof(unsigned int));
	printf("
");
	printf("        float is %2d bytes 
", sizeof(float));
	printf("      float * is %2d bytes 
", sizeof(float *));
	printf("       double is %2d bytes 
", sizeof(double));
	printf("     double * is %2d bytes 
", sizeof(double *));
	printf("  long double is %2d bytes 
", sizeof(long double));
	printf("
");
	printf("  signed char is %2d bytes 
", sizeof(signed char));
	printf("         char is %2d bytes 
", sizeof(char));
	printf("       char * is %2d bytes 
", sizeof(char *));
	printf("unsigned char is %2d bytes 
", sizeof(unsigned char));
	getch();
}
Comment

PREVIOUS NEXT
Code Example
C :: c printing char pointer 
C :: bash while loop n times 
C :: int_min in c 
C :: Gemfile.lock`. It is likely that you need to grant write permissions for that path. 
C :: remove axis numpy array 
C :: Convert mpg / mp4 to gif with ffmpeg 
C :: c sleep milliseconds 
C :: how to get input in 2d array in c 
C :: isspace 
C :: Write a C program to merge two array to third array. 
C :: sqlserver insert with set identity 
C :: c convert float to string 
C :: form controls in bootsrap 
C :: print hello world in c 
C :: concatenate two strings without standard library in C 
C :: read file c 
C :: mongo connect db 
C :: maximo comun divisor 
C :: 2d array in c 
C :: why do you jerk while falling aslee 
C :: yum install supervisor amazon linux 
C :: c char to int 
C :: fifo in c 
C :: stack pop 
C :: deleting a word with copy fuction c code 
C :: recursion function bangla 
C :: Multiplying a u64 to u128 in Rust 
C :: reverse a number in c 
C :: convert c to python online 
C :: #pragma pack(1) in c 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =