Re: I'm sorry...



On 30 November, 1998 - sml13@cornell.edu sent me these 1.4K bytes:

> Good point...BUT, this dies too:
> 
> #include <stdio.h>
> #include <string.h>
> 
> void main() {
>     char* var = "hey you";
> 
>     printf ("%s\n", strtok (var, " "));
> }

That's because you're doing the exact same thing.

read: man strdup, man malloc, man free, man strcpy

/Tomas
-- 
Tomas Ögren, stric@ing.umu.se, http://www.ing.umu.se/~stric/
|- Student of Computer Science at the University of Umeå
`- Sysadmin at {ing,acc}.umu.se



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]