One huge problem is pointer b only points to a one-byte empty string which can not be expanded. Since you want a string of 8 characters then you have to allocate memory for it something like this char b[9] = {0}; . That will allocate memory for 8 characters plus a null terminator, and initialize all of them with 0.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343