Re: strdup/strcpy

From: Mark Garringer (
Date: 11/07/02

>If you don't wish to maintain two separate arrays, one of the namelist
>and one of the currency short names, then Mathew's method would be
> >easiest.
>That is,
>      snprintf(buf, sizeof(buf), "coins %s", currency_types[cur]);
>      obj->name = strdup(buf);

That is so funny. I was just coming home from work and it hit me. "Why don't
I put "coins %s" in the snprintf! :)

Thanks for you help!


The new MSN 8: smart spam protection and 2 months FREE*

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT