P
Peter Drese
Hello,
I have to write an exam and I am not sure about implicit typecasting. Can
somebody please tell me of what type the following c-statements are? And why
they are of this type? It is also possible that the statements are wrong.
first exercise:
int x;
unsigned int ux;
float f;
char *p1;
void *p3;
int (*pf)(void);
void (*pf2)(double);
int f1(void);
void f3(double x2);
p1 = p3;
x += f;
p3 + ux;
pf = f1();
pf2 == f3;
pf2 = f3;
pf = f1;
p3 ? x : f;
*p3;
second exercise:
int x;
float f;
char *p1;
int f1(int x1);
int f2(int x1, int x2);
int f3(double x1);
int (*pf)(int);
int (*pf2)(double);
p1 ? f1 : pf;
pf = f1;
pf = f1(x);
pf2 = pf;
pf == f1;
pf == pf2;
f = f3(f);
f1 == f2;
++f;
p1 ? i : f;
Thanks in advance!
Greets Pete
I have to write an exam and I am not sure about implicit typecasting. Can
somebody please tell me of what type the following c-statements are? And why
they are of this type? It is also possible that the statements are wrong.
first exercise:
int x;
unsigned int ux;
float f;
char *p1;
void *p3;
int (*pf)(void);
void (*pf2)(double);
int f1(void);
void f3(double x2);
p1 = p3;
x += f;
p3 + ux;
pf = f1();
pf2 == f3;
pf2 = f3;
pf = f1;
p3 ? x : f;
*p3;
second exercise:
int x;
float f;
char *p1;
int f1(int x1);
int f2(int x1, int x2);
int f3(double x1);
int (*pf)(int);
int (*pf2)(double);
p1 ? f1 : pf;
pf = f1;
pf = f1(x);
pf2 = pf;
pf == f1;
pf == pf2;
f = f3(f);
f1 == f2;
++f;
p1 ? i : f;
Thanks in advance!
Greets Pete