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

Answer Posted / ravi.jnv

Its possible by pointers.
-----------------
int one,two;
int *ptrOfOne,*ptrOfTwo;
int size;
ptrOfOne = &one;
ptrOfTwo = &two;
size = ptrOfOne - ptrOfTwo ; /* u can get minus value also
depending upon stack how it pushes variables */

Is This Answer Correct ?    6 Yes 28 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

655


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

772


Describe wild pointers in c?

640


What is the use of getch ()?

638


i have a written test for microland please give me test pattern

2183






Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

1600


What is malloc calloc and realloc in c?

670


What is a built-in function in C?

797


Is linux written in c?

601


Explain how can you determine the size of an allocated portion of memory?

624


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

733


Explain what is gets() function?

634


Is it valid to address one element beyond the end of an array?

675


List the different types of c tokens?

629


Why is it that not all header files are declared in every C program?

683