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

How can I insert or delete a line (or record) in the middle of a file?

799


Can a void pointer point to a function?

778


What is a const pointer in c?

879


What are reserved words with a programming language?

846


What does the characters “r” and “w” mean when writing programs that will make use of files?

1199


What is a struct c#?

789


Subtract Two Number Without Using Subtraction Operator

599


Explain About fork()?

849


What are control structures? What are the different types?

856


What is pre-emptive data structure and explain it with example?

3489


Write a program to print all permutations of a given string.

948


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

915


What's the difference between constant char *p and char * constant p?

906


What does it mean when a pointer is used in an if statement?

869


c language interview questions & answer

1712