[Solved] cout not working in c++ after taking line input (getline)


Add cout.flush() (or std::endl which implicitly flushes) after each cout statement.

cout uses buffered output,
using cout.flush() will clear the buffer and force the contents being written out.

Thanks πάντα ῥεῖ for guidance

solved cout not working in c++ after taking line input (getline)