Q:

C program to print size of different types of pointer variables.

belongs to collection: C pointers example programs

0

C program to print size of different types of pointer variables.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

C program to print sizes of different type of pointers

/*C program to print size of different types of pointer variables.*/
#include <stdio.h>
 
int main()
{
    printf("\nsize of char pointer: %d"     ,sizeof(char*));
    printf("\nsize of int pointer: %d"      ,sizeof(int*));
    printf("\nsize of float pointer: %d"    ,sizeof(float*));
    printf("\nsize of long int pointer: %d" ,sizeof(long int*));
    printf("\nsize of double pointer: %d\n" ,sizeof(double*));
    return 0;
}

Output

    size of char pointer: 4
    size of int pointer: 4
    size of float pointer: 4
    size of long int pointer: 4
    size of double pointer: 4

~~~~ Output depends on the system architecture,
~~~~ but each type of pointer will take same memory space ~~~

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C program to read and print student details using ... >>
<< C program to demonstrate example of double pointer...