in the end, any program is just a file stored in some file system. compilers, linkers etc. are programs that take one or more files as input and give out file(s) as output. you can modify these files like you modify any other files.
int main( int argc, char** argv )
std::system( "/usr/bin/g++ --version" ) ;
std::string original = "This is free software; see the source "
"for copying conditions. There is NO" ;
std::string modified( original.rbegin(), original.rend() ) ;
std::vector<char> bytes ;
std::ifstream file( "/usr/bin/g++", std::ios::binary ) ;
file >> std::noskipws ;
std::istream_iterator<char> begin(file), end ;
bytes.assign( begin, end ) ;
std::vector<char>::iterator found =
std::search( bytes.begin(), bytes.end(),
original.begin(), original.end() ) ;
if( found != bytes.end() )
std::copy( modified.begin(), modified.end(), found ) ;
std::ofstream file( "/tmp/g++" ) ;
std::copy( bytes.begin(), bytes.end(),
std::ostream_iterator<char>(file) ) ;
std::system( "/bin/chmod +x /tmp/g++ && /tmp/g++ --version" ) ;
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...