Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C PR0gramming..

Name: Anonymous 2012-05-26 3:39

Neeeed 'C' Help.

I need to read in input from the command line argument and open the text file ( 2nd arguement; nums1.txt in this case)
ie:  ./shitprogram nums1.txt

and so what would i be inputting here:
fopen("????","r");

I know that argv[1] = "nums1.txt" but how would i use this as a variable in fopen() ?

Name: Anonymous 2012-05-26 19:50

>>12
not that dude, but if the FILE* is a local variable to a function that is initialized to a call to fopen, then I name the variable in accordance to what is stored in the file, or what will be written to the file. If the FILE* is just a parameter to some generic printing or reading function for a data type, then I'll either name the parameter input or output, depending on if data is being read or written to it.

this is all pedantic of course.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List