Fixed some errors

Added a while loop in the main function.

Fixed the errors. Changed string to char.

Can be compiled without errors now.