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
What are logical errors and how does it differ from syntax errors?
Can you define which header file to include at compile time?
What is an identifier?
Write a program to use switch statement.
What is a header file?
Who is the founder of c language?
How do we open a binary file in Read/Write mode in C?
Why is c faster?
Differentiate between calloc and malloc.
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What are the c keywords?
Explain modulus operator. What are the restrictions of a modulus operator?
What is sizeof in c?
Are the variables argc and argv are local to main?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.