strcat causing segmentation fault?
I am having a wierd issue. I am doing a simple strcat and getting a segmentation fault. Here is a code snippet.
Code:
#include <stdio.h>
#include <string.h>
sname="/";
printf("2 %s & %s\n",sname, name);
strcat(sname, name);
This produces:
2 / & rb123121
Segmentation fault (core dumped)
Any ideas why this would happen? I have string.h included.
________________
Ok, after playing some more, it seems to be occuring with any string functions. I have all the right libraries included don't I?