ConsoleTom
Member
Hi !
i have a struct
struct mystruct={int x; int y};
and declare 2 variables of its kind:
struct mystruct s1 = {10,10};
struct mystruct s2[] = {{10,10}}
i have a function:
void func(struct mystruct 1* a)
...
Now i want to pass an argument to this func:
func(s1); //this causes the error: incompatible type for argument 2 of func
func(&s1); //this works
func(s2); //this works
where is the difference here ?
---------------------------------
Are the following declarations exactly the same ?
1.
struct x = {
int a;
int b;}myx = {10,10};
2.
struct x = {
int a;
int b;};
struct x myx = {10,10};
---------------------------------
What means near initialisation ? Or what is wrong when this warning appears ?
Thanks.
Tobias
i have a struct
struct mystruct={int x; int y};
and declare 2 variables of its kind:
struct mystruct s1 = {10,10};
struct mystruct s2[] = {{10,10}}
i have a function:
void func(struct mystruct 1* a)
...
Now i want to pass an argument to this func:
func(s1); //this causes the error: incompatible type for argument 2 of func
func(&s1); //this works
func(s2); //this works
where is the difference here ?
---------------------------------
Are the following declarations exactly the same ?
1.
struct x = {
int a;
int b;}myx = {10,10};
2.
struct x = {
int a;
int b;};
struct x myx = {10,10};
---------------------------------
What means near initialisation ? Or what is wrong when this warning appears ?
Thanks.
Tobias