Need help identifying C variable types.
Hi guys, I need help with identifying type declaration of variable p.
I've attempted, but I am not certain of my answers. Can someone help me out please ? 1) Code:
int *vals[5] = [1,3,5,3,5]; 2) Code:
char *foo(int x) Code:
p = foo(5); 3) Code:
typedef unsigned short u_int16_t; p is type pointer to u_int16_t of type unsigned short ? 4) Code:
p = printf("Hello!") 5) Code:
struct trapframe Code:
p = tf->tf_v0; 6) Code:
struct trapframe tf = ...; Thank you very much in advance ! |
Quote:
read it as int **vals and then p = **(vals+2) Quote:
and also p is char* thus is _maybe_ a pointer to a sequence of char null terminated 3) Quote:
u_int16_t* val = ...; p = *val; in this way it should be clear that val is a pointer type and p is a u_int_16_t (well it isn't defined but it should be like that) Quote:
Quote:
Quote:
Quote:
Quote:
|
All times are GMT -5. The time now is 10:29 AM. |