write a program for size of a data type without using
sizeof() operator?
Answers were Sorted based on User's Feedback
Answer / mazhar shaikh
datatype a,*p,*q;
p=&a;
q=p+1;
cout<<abs(int(p)-int(q))<<endl;
| Is This Answer Correct ? | 5 Yes | 7 No |
Answer / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int integer[2],p;
float floating[2],q;
char character[2],r;
double doubling[2],s;
clrscr();
p=(integer+1)-integer;
q=(floating+1)-floating;
r=(character+1)-character;
s=(doubling+1)-doubling;
printf("the sizeof int is :%d",p);
printf("\nthe size of float is :%d",q);
printf("\nthe size of character is :%d",r);
printf("\nthe size of double is :%d",s);
getch();
}
thank u
| Is This Answer Correct ? | 5 Yes | 11 No |
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
What is bss in c?
which type of aspect you want from the student.
a C prog to swap 2 no.s without using variables just an array?
State the difference between x3 and x[3].
What is the purpose of main( ) in c language?
Write the control statements in C language
What is the best organizational structure?
Which function in C can be used to append a string to another string?
How do you determine the length of a string value that was stored in a variable?
Can we replace the struct function in tree syntax with a union?
Explain how do you determine whether to use a stream function or a low-level function?