Visual studio c++ shows that \"string\" on line 24 has one array element, but the top contains all the text that was input by the user. But when I send to PutString(), it di
You are returning pointer to a variable that is local to the function in GetString(), when the function returns, the space allocated to the variable is reclaimed.
To fix these you can either dynamically allocate space for the character array or declare it as static so that the lifetime of the variable becomes the entire program.