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 / rajesh
#include<stdio.h>
int main()
{
int p;
printf("%d\n",(char*)(&p+1)-(char*)(&p));
return 0;
}
| Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
Explain how do you determine whether to use a stream function or a low-level function?
What are the 5 data types?
Do string constants represent numerical values?
Explain what is the use of a semicolon (;) at the end of every program statement?
Which function in C can be used to append a string to another string?
What are the types of data files?
Write a program to swap two numbers without using third variable in c?
How does placing some code lines between the comment symbol help in debugging the code?
What is the benefit of using #define to declare a constant?
What is the return type of sizeof?
Under what circumstances does a name clash occur?
What is wrong with this statement? Myname = 'robin';
What will be your course of action for a push operation?
Can one function call another?
Is it better to use a macro or a function?