Open a C++ file from another C++ file?

Title seems confusing but it is not in reality .
What I'm trying to say here is that , From a C++ file (Compiled), when the user chooses the second option, I want another window that pops out and be able to convert temperature.
You are trying to execute another PROCESS from your host. You need to ask the OS for help with this one. What OS are you running?
My OS is Windows 7 , and once done with this topic I have another question .

Other question:
In my program, it basicaly converts celcius to farhenheit and the other way around too.
I've add some line ( I/O ) commands to put each conversion into a log.I've managed to do that but, each new conversion replace the first line only.I want to do that :

1st conversion
2nd conversion
...
For your first question: http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx
Don't be intimidated, it looks more complicated then it really is. Just remeber to enter the full UNC path for your 1st/2nd argument and you'll do fine. Let me know if you have trouble with it.

For your second question. You want to open the output file with the std::ios_base::app argument. This tells the compiler to append whatever data to the end of the file you're opening. See here: http://www.cplusplus.com/reference/iostream/ofstream/ofstream/

EDIT:
1
2
3
4
#include <fstream>
/* code code code */

std::ofstream outputfile(OutputFileNameAndExtention, std::ios_base::app);

The std parts are only important if you aren't using the std namespace. "OutputFileNameAndExtention" can be a string.
Last edited on
Topic archived. No new replies allowed.