C++ - terminate called after throwing an instance of 'std::bad_alloc' what() I got a C++ client/server simple program. When client close connection with server, sever will output the error as my subject stated. Need someone to look on my code and let me know whats wrong payment: $10 usd mode: paypal send a p.m if u can work right away.