comp.lang.c
[Top] [All Lists]

Re: Implementation-defined behaviour

Subject: Re: Implementation-defined behaviour
From: Ioannis Vranos
Date: Fri, 28 Mar 2008 16:51:32 +0200
Newsgroups: comp.lang.c

Kenny McCormack wrote:
> 
> And:
> 
> 1) How to declare main()  { Always a hit! }

Easy. Under C90:

int main(), int main(void), int main(int argc, char *argv[]), int
main(int argc, char **argv), and those also with no return type
(implicit int).


> 2) Why not to cast the return value of *alloc()
> 
> That's it folks.  Enjoy!


malloc() doesn't need a cast in C, it needs in C++, because in C there
is implicit conversion of void * to any other pointer type, but not in
C++ where it requires a cast.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy