I have a function ./transform
that needs to take in two command line arguments for an input and output file.
Like so: ./transform "inputfile" "outputfile"
I am then trying to read the file using fopen
to store each character in the file into a character array char token[1024]
. The total number of characters in the input file will always be <= 1024.
I am receiving errors about fopen
not having the right amount of arguments. Here is pseudo-code of what I am trying to accomplish.
void main(FILE *inputFile, FILE *outputFile){
char token[1024];
token = fopen(&inputFile, "r");
}
Yes, I am aware I am trying to assign a FILE value to a Char value... I wrote it this way to show that I want each character from the inputFile stored in the character array. I am unsure how to do so properly. After executing the program's code (converting hex and int values from file to ASCII), I need to save the converted ASCII text into the user-defined output file.