C Programming - Complicated Declarations
Exercise : Complicated Declarations - Point Out Errors
1.
Point out the error in the following program (in Turbo C under DOS).
#include<stdio.h>
union emp
{
int empno;
int age;
};
int main()
{
union emp e = {10, 25};
printf("%d %d", e.empno, e.age);
return 0;
}
2.
Point out the error in the following program.
#include<stdio.h>
#include<stdlib.h>
int main()
{
static char *p = (char *)malloc(10);
return 0;
}
3.
Point out the error in the following program.
#include<stdio.h>
void display(int (*ff)());
int main()
{
int show();
int (*f)();
f = show;
display(f);
return 0;
}
void display(int (*ff)())
{
(*ff)();
}
int show()
{
printf("IndiaBIX");
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers