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

Write a code to determine the total number of stops an elevator would take to serve N number of people.

1031


What is the mean of function?

891


What is the difference between fread buffer() and fwrite buffer()?

947


what is a function method?give example?

2159


hi, which software companys will take,if d candidate's % is jst 55%?

1900


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16119


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

1873


find out largest elemant of diagonalmatrix

1925


Explain what is the difference between text files and binary files?

902


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1044


how logic is used

1743


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2471


What is variable initialization and why is it important?

881


How many types of operator or there in c?

868


Calculate 1*2*3*____*n using recursive function??

1791