Mail Archives: djgpp/1997/03/03/13:54:36
Paul Derbyshire (ao950 AT FreeNet DOT Carleton DOT CA) wrote:
: Also: no typecast is needed to assign the result of a malloc or calloc to
: a pointer.
: int *bunch_of_ints;
: bunch_of_ints=malloc (3000*sizeof(int));
: will work just as well as
: int *bunch_of_ints;
: bunch_of_ints=(int *)malloc (3000*sizeof(int));
Not quite true. Both work equally well in (non-ANSI) C, but only the latter
is compliant with ANSI C regulations (and hence C++).
--
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.
- Raw text -