Salve a tutti, è da poco che studio C e avrei una domanda da porvi, prendiamo questo semplice codice:
Qualcuno sa dirmi perchè nell'array keys, invece di starci solo i punti interrogativi, compaiono anche altri caratteri strani che non ho battuto a tastiera?codice:#include <stdio.h> main() { char str[1024], keys[1024]; int i, c, j; for(i = j = 0; (c = getchar()) != '\n' && i < 1024; i++ ) { if( c == '!' ) { keys[j] = c; j++; } } printf("%s\n", keys); system("PAUSE"); return 0; }