On 1996-06-10 14:02, David Nugent of 3:632/348 wrote:
> FA> char *txt;char *pat;char *ptr;
> FA> txt = (char*) malloc(strlen(buf)+1);
> FA> pat = (char*) malloc(strlen(wrd)+1);
DN> Just out of interest, why cast the return from malloc()? If it is because
DN> it has no prototype, then you should do the /correct/ thing and include
DN> stdlib.h.
I believe C++ compilers, when compiling C code, will complain about
the lack of a cast. No reason not to make your code C++-friendly,
although I never do. BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|