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


Please Help Members By Posting Answers For Below Questions

Is there any demerits of using pointer?

803


Why do we need functions in c?

737


What is the purpose of the preprocessor directive error?

906


What is the difference between local variable and global variable in c?

900


How many parameters should a function have?

861


What are the advantages of using Unions?

833


Is this program statement valid? INT = 10.50;

891


Why header files are used?

826


What is a keyword?

938


Are pointers integers in c?

791


Write a Program to accept different goods with the number, price and date of purchase and display them

5856


Explain what is meant by 'bit masking'?

855


why wipro wase

2033


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2267


Explain zero based addressing.

774