Link to home
Start Free TrialLog in
Avatar of Deepikak
Deepikak

asked on

strcat() -- segmentation fault Core Dumping

Avatar of muskad202
muskad202

the destination string doesn't have enough memory (space) allocated to it..
complete strcat example:

char *buffer;

buffer = (char*) malloc(1024);
memset(buffer, 0, 1024);

strcat(buffer, "initial strcat\n");
strcat(buffer, "another strcat\n");

ASKER CERTIFIED SOLUTION
Avatar of plushey
plushey

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nothing has happened on this question in over 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by plushey (even though it was late it was most comprehensive).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer