try it straight c++, and if you are on windows make sure you have this line: CONFIG += console in your project file
int main(int argc, char *argv[])
{
//QCoreApplication a(argc, argv);
CClient client;
client.create();
std::cout << "input a number (-1 to quit) " << std::endl;
int nRetVal = 0;
std::string buffer;
while (std::getline(std::cin, buffer)) // Where do I enter text within the console app??
{
if (buffer.compare("-1") == 0)
{
break;
}
client.Send(buffer.c_str());
nRetVal = client.Recieve();
std::cout << "Received " << nRetVal << " from server." << std::endl << std::endl;
std::cout << "input a number (-1 to quit) ";*/
}
std::cout << "Client says bye bye!!" << std::endl;
//return a.exec();
return 0;
}
int main(int argc, char *argv[])
{
//QCoreApplication a(argc, argv);
CClient client;
client.create();
std::cout << "input a number (-1 to quit) " << std::endl;
int nRetVal = 0;
std::string buffer;
while (std::getline(std::cin, buffer)) // Where do I enter text within the console app??
{
if (buffer.compare("-1") == 0)
{
break;
}
client.Send(buffer.c_str());
nRetVal = client.Recieve();
std::cout << "Received " << nRetVal << " from server." << std::endl << std::endl;
std::cout << "input a number (-1 to quit) ";*/
}
std::cout << "Client says bye bye!!" << std::endl;
//return a.exec();
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks