is it possible to grab data from an .exe file in c++? -
i new @ c/c++,
want call .exe file displays 2 numbers , able grab 2 numbers use them in code. call .exe file i've used system command, still not able grab 2 numbers displayed .exe file
char *files = "mypath\file.exe"; system (files);
i think better aproach: here create new process, , read data process gives you. tested on os x 10.11 .sh file , works charm. think work on windows also.
file *fp = popen("path exe","r"); if (fp == null) { std::cout << "popen null" << std::endl; }else { char buff[100]; while ( fgets( buff, sizeof(buff), fp ) != null ) { std::cout << buff; } }
Comments
Post a Comment