January 15th, 2011, 08:36 PM
Strcpy - problem!!!
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 is it 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! :(
I am having the exception at "strcpy(lst_personalInfo->sName, lst_fieldValues.sValue);" and I don't know why. Please help.
typedef struct st_personal_info
typdef struct st_field_values
char lsToPass = "MICHAEL";
Many thanks everyone!
January 15th, 2011, 08:52 PM
lst_personalInfo is a pointer to a struct st_personal_info, that you have never initialized to anything at all.
Do you agree? Disagree? And remember, it's all about the reputation power...
January 16th, 2011, 12:53 AM
January 16th, 2011, 12:28 PM
Thanks TheOtherDino. You're right! i tried using malloc (suggested by CommonTater from another forum. haha.) and it's ok now. thanks again! really appreciate it! :D
Originally Posted by TheOtherDino