I need some help regarding using linux command inside C++ code instead of writing those commands on the screen each time I run the program.Someone from this forum suggested me this example "http://www.cplusplus.com/reference/iostream/ios/rdbuf/" which I found it easier and it worked as well but not when I tried to use it with the output of this command
system("diff /home/test1.txt /home/test2.txt");
Does anyone have any idea why? it still prints the output on to the screen and not to a file.