Can U write a C-program to print the size of a data type
without using the sizeof() operator? Explain how it works
inside ?
Answer Posted / saikat
#include <stdio.h>
int main()
{
float a[2];
int size = (char*)&a[1] - (char*)&a[0];
printf("%d
",size);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why do we use static in c?
What is the difference between text and binary modes?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is meant by high-order and low-order bytes?
What is abstract data structure in c?
Differentiate between the = symbol and == symbol?
What is stack in c?
What happens if header file is included twice?
What are the types of macro formats?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
What is the difference between null pointer and wild pointer?
What are the three constants used in c?
How can I make sure that my program is the only one accessing a file?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.