TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: David Nugent
from: Adam Fitzpatrick
date: 1996-06-28 21:35:36
subject: Find a word

Quoting David Nugent to Frank Adam:



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

DN>because it has no prototype, then you should do the /correct/ thing

DN>and include stdlib.h.



Eh? I thought it was because malloc returns a void*, and most compilers will

give you a warning because a char* is different to a void*.



... Artificial intelligence is no match for natural stupidity.

--- FMailX 1.02
* Origin: Power BBS - +61-2-858-4114 - Files/Games/EchoMail/Internet (3:711/953)
SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 808 809 932 934 946
SEEN-BY: 711/953 963 712/515 713/888 714/906 800/1
@PATH: 711/953 410 808 934

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™.