TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: David Nugent
from: Paul Edwards
date: 1996-06-13 19:07:18
subject: Find a word

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)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.