Click to See Complete Forum and Search --> : fstream problem


BageDevimo
September 28th, 2007, 12:25 AM
Hey,

I have the following code

#include <iostream>
#include <fstream>

using namespace std;

int main(int argc, char *argv[])
{
ofstream logWrite("CompileLog.log");
for(int i=1; i<argc ;i++ )
{
logWrite << argv[i] << endl;
cout << argv[i] << endl;
system("pause");
logWrite.close();
}
}

When I compile it, it compiles fine.
If I start it using CMD "ArgumentTester.exe Hello" it writes to CompileLog.log file.
But, when I drop a file onto it eg "test.txt" it doesn't write. Doesn't anyone know why..?

BageDevimo,

Paul McKenzie
September 28th, 2007, 03:42 AM
What do you mean by "drop a file"?

Regards,

Paul McKenzie

BageDevimo
September 28th, 2007, 05:34 AM
Like, pick up the a file (click and hold) then drop it onto it...

Like one might do to open a txt file with notepad...

BageDevimo,

Paul McKenzie
September 28th, 2007, 06:03 AM
Like, pick up the a file (click and hold) then drop it onto it...

Like one might do to open a txt file with notepad...

BageDevimo,Please post your question in the Windows API forum, as this is dependent on the OS (Windows), and title your post differently. This has absolutely nothing to do with fstream, but it has to do with the Windows API and the GUI.

Regards,

Paul McKenzie