how to find the size of the data type like int,float
without using the sizeof operator?

Answer Posted / test

#include<stdio.h>
main()
{
int kh[2]={10,20};
int * ptr_kh=kh;
printf("%d",((char* )(ptr_kh+1)-(char*)ptr_kh));

}

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can math operations be performed on a void pointer?

742


How are variables declared in c?

819


I have seen function declarations that look like this

781


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

2639


Is c still relevant?

835


What is modifier & how many types of modifiers available in c?

800


What is a far pointer in c?

776


Why void main is used in c?

773


Write a c program to demonstrate character and string constants?

1890


What are pointers?

839


how do you execute a c program in unix.

841


Explain the difference between #include "..." And #include <...> In c?

785


What is type qualifiers?

853


What is preprocessor with example?

770


application attempts to perform an operation?

1709