Hi! All,
I am running VC++ , my project requires to read a file as an argument and generate a new file as an output argument.
I am able to compile the code from command prompt
C:\project\list.exe test.txt out.txt
here test.txt is the input for the program
and out.txt is the file used for output.
but there is way to configure this link using VC++ menu , properties or setting.
I need to configure these in VC++.
Please let me know the steps .
bcoz when i compile the code from VC++ its gives me
an error : Usage:directory <inputfile> <outputfile>Press any key to continue
THAT MEANS ITS NOT ABLE TO ACCESS THESE FILES
my code
void main(int argc,char *argv[])
{
if (argc !=3)
{
cout << "Usage:directory <inputfile> <outputfile>";
exit(1);
}
fstream readStream(argv[1],ios::in);
fstream writeStream(argv[2],ios:ut);
if (! readStream.is_open() || ! writeStream.is_open()) {
cout << "Cannot open input/ouptut files. Try again!";
exit (1);
}
please tell me how do i run this code from vc++ , gui
and how do i link the input and output files.
thanz in advance.
Regards
Arpan
I am running VC++ , my project requires to read a file as an argument and generate a new file as an output argument.
I am able to compile the code from command prompt
C:\project\list.exe test.txt out.txt
here test.txt is the input for the program
and out.txt is the file used for output.
but there is way to configure this link using VC++ menu , properties or setting.
I need to configure these in VC++.
Please let me know the steps .
bcoz when i compile the code from VC++ its gives me
an error : Usage:directory <inputfile> <outputfile>Press any key to continue
THAT MEANS ITS NOT ABLE TO ACCESS THESE FILES
my code
void main(int argc,char *argv[])
{
if (argc !=3)
{
cout << "Usage:directory <inputfile> <outputfile>";
exit(1);
}
fstream readStream(argv[1],ios::in);
fstream writeStream(argv[2],ios:ut);
if (! readStream.is_open() || ! writeStream.is_open()) {
cout << "Cannot open input/ouptut files. Try again!";
exit (1);
}
please tell me how do i run this code from vc++ , gui
and how do i link the input and output files.
thanz in advance.
Regards
Arpan