It's not working at all it just keeps getting my inputs.
Also, could you give me information on how to exit the program whenever I want?(Suppose the program is working correctly)like when I pressed enter or entered 0 on both fields it exits?
(you could do something similar with a char array, length == 0 would meant the first character was the null terminator. But std::string is safer, less worry about what happens if the user enters too many characters).