Let's say here is my code:
int main() {
char *number;
system("grep total myfile > filename");
printf(number);
}
This code finds the line from myfile containing "total" and outputs it into a new file called filename. I am trying to have the output set to the char "number" directly, instead of having to write/read from filename. Is there a way to do this?
Thanks for any help!
number, or do you want to read the filefilenameand set the value ofnumberaccordingly?openfilename and write it in there yourself, of course.