|
-
February 8th, 2007, 01:29 AM
#4
Re: need help to passing string in function
I am trying to close a file using a function I created called closeFile
I tried to pass in filedir but it did not work. I tried the code below and it does not work. Can somebody help me here. The main works and If I move the code that is closeFile to main it works but does not in the function.
need some help here
Thanks in advance.
here is part of my main:
// fileOutpName is entered from the GUI
string filedir = "C:\\training_output\\" + FileOutputName;
out_stream.open (filedir.c_str());
globalfile = filedir; // set filedir to a global string
....
...
....
closeFile(); // call closeFile
void CStrengthCoachDlg::closeFile(void) //close out file
{
ofstream out_stream;
out_stream.close();
string systemcall = "START " + globalfile;
system(systemcall.c_str());
return;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|