I'm trying to find some footing with incput from the console, and have a question about the "remaining characters" from an input string. Say I buffer an array to take 16 characters, and the user inputs 10. The remaining 6 are filled with what seems to be gibberish... can someone explain where this comes from?
Enter some characters... asd fgh jkl
asd fgh jkl
[0]ASCII: 97 Character: a
[1]ASCII: 115 Character: s
[2]ASCII: 100 Character: d
[3]ASCII: 32 Character:
[4]ASCII: 102 Character: f
[5]ASCII: 103 Character: g
[6]ASCII: 104 Character: h
[7]ASCII: 32 Character:
[8]ASCII: 106 Character: j
[9]ASCII: 107 Character: k
[10]ASCII: 108 Character: l
[11]ASCII: 0 Character:
[12]ASCII: -96 Character: á
[13]ASCII: -3 Character: ²
[14]ASCII: 127 Character: ⌂
[15]ASCII: 0 Character:
Process returned 0 (0x0) execution time : 5.772 s
Press any key to continue.
Output line 11 shows the null-terminator, but where to 12-15 come from?