Wednesday, April 2, 2014

File IO Using Main Arguments

First, compile the code. 
Using the command prompt, the first argument is the file name. 
While the second argument is the name of the output file you want.
You may also specify the destination path of the file output on the second argument.

Method 1:
This will create the file poem.txt on the same folder where I saved my fileio9.c 


Method 2:
This on the other hand will save the poem.txt on the desktop




This is from my Intro to Programming Class (ANSI-C). I'll try to post some of my code snippets here. Hope I'll be able to do it. 

No comments:

Post a Comment