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 |
Can we use visual studio for c?
Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
how to swap four numbers without using fifth variable?
why effort estimation is important?
Why do we use int main instead of void main in c?
What is an lvalue and an rvalue?
what does ‘segmentation violation’ mean?
How to print India by nested loop? I IN IND INDI INDIA
Do you know the difference between malloc() and calloc() function?
Do pointers take up memory?
write a program in c language that uses function to locate and return the smallest and largest integers in an array,number and their position in the array. it should also find and return the range of the numbers , that is , the difference between the largest number and the smallest.