this is the source code
int main() { char str[]=\"dance\"; char str1[]=\"hello\"; char str2[]=\"abcd\"; strcat(str1,str2); printf(\"%s\",s
as I have not given the size of str1 , both str1 and str are present in the memory one after another
str1
str
like
h e l l o \0 d a n c e
so when I concatenate str1 and str2 following thing happens...
str2
a replaces \0 b replaces d c replaces a d replaces n \0 replaces c
and hence str is altered