Re: strdup/strcpy

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

I seem to be having a really hard time with this, so I hope someone can give
me a quick answer (and maybe a slap on the head).

Since I have added additional currency types to my game, I have done some
minor changes to create_money. But I need to get the currency type added to
the keyword list.

The code now is very direct, obj->name = strdup("coins gold");

But what I need to so is something like: obj->name = strdup("coins

cur is an integer I passed into create_money. I don't want (obviously) the
literal string 'currency_types[cur]' in my object name list.

Anyone, please?


Add photos to your e-mail with MSN 8. Get 2 months FREE*.

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

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