Here is my struct
Code:
struct pdat {
struct playerQuestInfo questData;
};
struct playerQuestInfo {
int questID[MAX_QUESTS_PER];
char *questObjectiveType[MAX_QUESTS_PER];
};
#define PLAYER_QUEST(ch) (ch)->questData
Here is the program setting the data in the above struct
Code:
const char *num = "1"; // This is only here to give an idea of where num is coming from.
const char *txt = "T";
PLAYER_QUEST(ch).questID[qd] = atoi(_strdup(num));
PLAYER_QUEST(ch).questObjectiveType[qd] = _strdup(txt);
My question is this: Do I need "_strdup" on an atoi?
Is it safe to do the following?:
Code:
PLAYER_QUEST(ch).questID[qd] = atoi(num);
Instead of:
Code:
PLAYER_QUEST(ch).questID[qd] = atoi(_strdup(num));
???
Thanks.