void f(struct s* pt)
{
malloc(sizeof(struct s));
}
....
Why i get warrning when i'am trying to compile it sth like:
Incompatible implicit declaration of build-in function 'malloc'
??
This has nothing to do with the struct, and everything to do with the fact
that you called malloc(), but you never included <stdlib.h>, so it hasn't
been declared. The compiler knows about malloc, though.
In C89, if you used a function without a declaration, it was assumed to return
int. malloc() doesn't return int, and the compiler is warning you that
this probably means something has gone wrong. Which it has.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
Thank's seebs