Hi,
I tried looking for threads for strcpy specifically for my problem but i just can't find the specific answers. Anyway, here's my problem....
I am trying to copy an array of string to my structure but i'm always getting an Unhandled Exception and points me to strcat.asm. Actually it is weird because in my program, it was not having the error not until i changed the value i passed. I tried several approach to test and debug why it is happening but it just keeps on giving the error.
Below is a snippet of my code for your reference. I'm trying to copy a string to two differently declared structures. I hope someone could help me... ASAP!
Code:
typedef struct st_personal_info
{
char sName[51];
int iAge;
char sAddress[501];
char sBirthday[11];
}ST_PERSONAL_INFO;
typdef struct st_field_values
{
char sField[6];
char sValue[51];
} ST_FIELD_VALUES;
...
int main()
{
ST_PERSONAL_INFO *lst_personalInfo;
ST_FIELD_VALUES lst_fieldValues;
char lsToPass[11] = "MICHAEL";
strcpy(lst_fieldValues.sValue, lsToPass);
strcpy(lst_personalInfo->sName, lst_fieldValues.sValue);
...
}
I am having the exception at "strcpy(lst_personalInfo->sName, lst_fieldValues.sValue);" and I don't know why. Please help.
Many thanks everyone!