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
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
#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); }
Describe wild pointers in c?
What is the use of getch ()?
i have a written test for microland please give me test pattern
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?
What is malloc calloc and realloc in c?
What is a built-in function in C?
Is linux written in c?
Explain how can you determine the size of an allocated portion of memory?
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
Explain what is gets() function?
Is it valid to address one element beyond the end of an array?
List the different types of c tokens?
Why is it that not all header files are declared in every C program?