C Programming - Complicated Declarations - Discussion
Discussion Forum : Complicated Declarations - Find Output of Program (Q.No. 1)
1.
What will be the output of the program?
#include<stdio.h>
int main()
{
char far *near *ptr1;
char far *far *ptr2;
char far *huge *ptr3;
printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
return 0;
}
Discussion:
31 comments Page 4 of 4.
P.yoga priya said:
3 years ago
@All.
Here is my coding.
#include<stdio.h>
int main()
{
int *a;
float *b;
char *c;
double *d;
int i;
float j;
char k;
double l;
a=&i;
b=&j;
c=&k;
d=&l;
printf("%d",sizeof(a));
printf("%d",sizeof(b));
printf("%d",sizeof(c));
printf("%d",sizeof(d));
}
Output:888.
Here is my coding.
#include<stdio.h>
int main()
{
int *a;
float *b;
char *c;
double *d;
int i;
float j;
char k;
double l;
a=&i;
b=&j;
c=&k;
d=&l;
printf("%d",sizeof(a));
printf("%d",sizeof(b));
printf("%d",sizeof(c));
printf("%d",sizeof(d));
}
Output:888.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers