| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | C |
CORRECTION!!! (told you I was tired)
myfunc( char *s)
{
int i;
char *p;
i = strlen(s);
p = malloc(i+1);
^^^ allow space for null terminator
strcpy(p,s);
/* do stuff to p */
free(p);
}
Sorry bout that
--- PPoint 1.88
* Origin: Silicon Heaven (3:711/934.16)SEEN-BY: 711/934 @PATH: 711/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™.