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

Answer Posted / lalit kumar

#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
int main()
{
char *a,*s, v='m';
a=&v;
s=a;
a++;
int intsize=(int)a-(int)s;
printf("%d",intsize);
getch();
return 0;
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

1621


What are the advantages and disadvantages of pointers?

570


can we have joblib in a proc ?

1650


Write a program to reverse a given number in c?

592


What is data structure in c and its types?

585






What are register variables in c?

570


What is difference between Structure and Unions?

633


What is the difference between functions getch() and getche()?

613


What are structures and unions? State differencves between them.

605


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

927


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

1779


Why we use break in c?

544


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

590


Do you have any idea how to compare array with pointer in c?

595


What is c mainly used for?

591