Woody1987
June 16th, 2009, 07:18 PM
In my program i want to find out the version of a program i have installed. This program is passed to a function which in turn runs for example:
system("dpkg -s firefox | grep Version");
This returns
Version: 3.0.11+build2+nobinonly-0ubuntu0.9.04.1
which is great, but, i want the output to be passed into char. Before i have done something like
system("dpkg -s firefox | grep Version > version.txt");
This saves the output of the command to version.txt but i would then need another function to read the info into a char, but can i bypass this step and pass the output of the first command straight into a char without having to save it to a file and then read it?
system("dpkg -s firefox | grep Version");
This returns
Version: 3.0.11+build2+nobinonly-0ubuntu0.9.04.1
which is great, but, i want the output to be passed into char. Before i have done something like
system("dpkg -s firefox | grep Version > version.txt");
This saves the output of the command to version.txt but i would then need another function to read the info into a char, but can i bypass this step and pass the output of the first command straight into a char without having to save it to a file and then read it?