how to find the size of the data type like int,float
without using the sizeof operator?

Answer Posted / vishnu948923

void main()
{
char *ptr1,*ptr2;
float fl;
ptr1 = &fl;
ptr2 = (&fl+1);

printf("%u",ptr2-ptr1);
}

Is This Answer Correct ?    29 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

569


How do I use void main?

621


Give basis knowledge of web designing ...

1566


What is the use of a conditional inclusion statement in C?

594


What should malloc() do?

637






What are dangling pointers in c?

633


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

808


Write a program that accept anumber in words

1244


Can we declare variables anywhere in c?

569


what are # pragma staments?

1619


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1468


What is a stream?

639


What are global variables and how do you declare them?

610


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

750


How do you print only part of a string?

603