what is the terminal command to run a c++ program and to output whatever is being printed to a .txt file.
Am using #xubuntu in a virtual machine with VMware #linux #cpp
@louiscouture I think this should do it:
g++ source.cpp && /.a > output.txt
@louiscouture correction this works:
g++ source.cpp && ./a.out > output.txt
I.e you compile and execute the program but redirect output to the text file.
QOTO: Question Others to Teach Ourselves An inclusive, Academic Freedom, instance All cultures welcome. Hate speech and harassment strictly forbidden.
@louiscouture correction this works:
g++ source.cpp && ./a.out > output.txt
I.e you compile and execute the program but redirect output to the text file.