Add function getstr, which can accept any length of the string input
from terminal.