After compiling and executing, the compiler gives an errorCode:int main() { char* date1="Dec 29, 8:30"; char* date2="Dec 28, 7:30"; char* year =" 2009"; strcat(date1,year); strcat(date2,year); return 0; }
After looking at the function strcat(), it takes 2 args of type of pointer and it is what i am passing to strcat(). I dont know i got the error. I need a explanation for it.Code:red 312 % time.out Segmentation fault
Thanks