Witam, pojawił się u mnie pewien dziwny problem, mianowicie kod:
#include <stdio.h>
#include <stdlib.h>
#define string_length 13
int main(){
char desired[string_length]={"Hello, world!"};
char input[string_length]={"JAmYv'&L_Cov1"};
char working_space[string_length]={"JAmYvl&L_Cov1"};
printf("string_length %d\n",string_length);
printf("desired %s\n",desired);
printf("input %s\n",input);
printf("working_space %s\n",working_space);
}
Daje wynik:
string_length 13
desired Hello, world!¤q·
input JAmYv'&L_Cov1Hello, world!¤q·
working_space JAmYvl&L_Cov1JAmYv'&L_Cov1Hello, world!¤q·
Wydawało by mi się, że zmienne nie powinny w ten sposób się łączyć, a wyczerpałem już wszystkie swoje pomysły na to dlaczego tak się dzieje - toteż proszę o pomoc.