/* 4/2/08 -- Jeff Ondich Danger with C strings. Why does this program produce crazy output? Why does it produce the very specific output it produces? Why does it crash after producing some output? */ #include #include int main() { int n = 123456789; char s[2]; char t[2]; int k = 987654321; strcpy(s, "goat"); strcpy(t, "meal"); printf("s = %s\n", s); printf("t = %s\n", t); printf("n = %d\n", n); printf("k = %d\n", k); strcat(s, t); printf("s = %s\n", s); printf("t = %s\n", t); printf("n = %d\n", n); printf("k = %d\n", k); return 0; }