write a program for size of a data type without using
sizeof() operator?

Answer Posted / g

This code will work in TC with 2 warnings but can get result

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

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

This is a way to get the size of data type...waiting for
any other way...

Is This Answer Correct ?    44 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a floating point in c?

594


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

672


What is the right type to use for boolean values in c? Is there a standard type?

557


What is a volatile keyword in c?

634


Explain About fork()?

640






What is meant by 'bit masking'?

879


pierrot's divisor program using c or c++ code

1722


What are the 4 types of unions?

601


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1293


Is malloc memset faster than calloc?

605


string reverse using recursion

1805


What is the acronym for ansi?

622


What are structures and unions? State differencves between them.

605


the question is that what you have been doing all these periods (one year gap)

1614


What is the purpose of ftell?

595