vendredi 29 mai 2015

After getting input string from the user, output includes some other character(s)

I decelerate a matrix of chars

char strs[3][200] = {'\0'};

and then try to insert string just for the first row

gets(strs[0]);

and then try to print all the rows

printf("1) ");
puts(strs[0]);
printf("2) ");
puts(strs[1]);
printf("3) ");
puts(strs[2]);

The result is

1) ☺me input from the user
2) ☺
3) ☺

why there is a "smiley" in the result ☺?

Aucun commentaire:

Enregistrer un commentaire