Well I\'ve weird problem with printf(). It\'s outputting garbage on screen. It\'s kind of connected with memory I guess. Have a look:
printf()
char strin
finish your string2 with null character '\0'
string2
'\0'
string2[19] = '\0';
Or you can do it in this way:
for (i; i < 19; i++) string2[i] = ' '; string2[i] = '\0'; // after the end of the loop i= 19 here