I have been going around and around with this code. It may be that I just dont have a firm grasp on how everything works. Could anyone help me identify why this doesnt work? I know its a logical error, but dont know what it is.
It does not work because the array blah is local to the function test(). When the function ends, the array no longer exists, and the accessing the pointer to its first element stored in firstName is an error
Thank you! I understand now why it doesnt work! Your awesome! I ended up using strcpy() to just copy the information over to the new dynamically allocated variable, which gave me the result I was looking for.