write a program for size of a data type without using
sizeof() operator?
Answer Posted / fanish
#include <stdio.h>
int main(){
printf("%d\n",((int*)0 + 1));
}
We can replace int with any other type
(Built-in/user-defined ) to get the size.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the difference between %d and %i?
How is null defined in c?
What is the difference between the = symbol and == symbol?
How can you be sure that a program follows the ANSI C standard?
What is the purpose of 'register' keyword in c language?
Explain what does a function declared as pascal do differently?
Are the expressions * ptr ++ and ++ * ptr same?
Why pointers are used in c?
What is pass by reference in c?
What is the difference between array and linked list in c?
How can you pass an array to a function by value?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What is the use of structure padding in c?
Can a void pointer point to a function?
What are the advantages and disadvantages of pointers?