hi all,
I've a truble with slimilar of this code..
1 2 3 4 5 6 7 8
struct first *fir;
struct second *sec;
func(struct firs *fi, struct s *se){
......
return func(fi,se); // return value from func which take pointer on struct firs and s
}
errno=func(fir,sec); // take pointer on struct first and second
//warning: passing argument 2 of 'func' from incompatible pointer type
I wrote two equal methog structs usage, but second take it's warning. Why it's happened?
In line 7, sec is a 'second *', but func() takes an 's *' as the second parameter.
hm, why myfunc take first parameter very well and broke on second?
I made something this
errno=func(fir,(struct second*)&sec);
and this
errno=func(fir,&sec);
but it's doesnt' work.
By the way, 'first', 'second', 'firs', and 's'? Were those the most meaningless names you could come up with?
my god, where? Warning is appeared when I call my_func here... errno=my_func(sec,buf); //warning: passing argument 2 of 'my_func' from incompatible pointer type
Curiously enough, that's exactly what I said in my first post.
In line 7, sec is a 'second *', but func() takes an 's *' as the second parameter.
helios, ok. Just I want to understood, which's method I gotta use there so as to replace that?
1 2 3 4 5 6 7
struct first *fir;
struct second *sec;
func(struct firs *fi, struct s se){ // if I do that, its not improve situation.
......
return func(fi,&se);
}
errno=func(fir,sec);// me need doing something with second argument here, but I don't know how.