run a file

How do i run a file? How do i then have it deleted (to keep clutter from being created)?
Last edited on
How do i run a file? How do i then have it deleted (to keep clutter from being created)?
that's C language, not C++.
We won't do your homework for you. Pusedo-code:
1
2
3
see if file already exists;
if (file exists) {clear that file; use this file;};
else create new file;
... im learning C++ on my own... and i cant find how to do this anywhere so im asking you guys...
Have you even read it? Because i see nothing in it about RUNNING a FILE or DELETEING it.
When you say "run a file," do you mean invoke one executable from another? Like, program A causes program B to start running?
i solved it anyway, my only question now is how do i delete a file to keep clutter to a minumum?
Last edited on
No need to yell.

To my knowledge, an .exe (runnable programs) can not use <fstream> to create .exe files. You can create and edit .txt files, which can be used to store variables even if the program shuts down.

.dll files (Dynamic Link Libraries) can be called to get code from outside the .exe, however they must be compiled like .exe files.
What's your problem? You came here asking for peoples help, so to call the people you're asking stupid, yelling at them, and being generally rude makes people not want to help you. You phrased your question in a manner that people didn't understand, and made an ass of yourself when people willing to help you asked you to clarify, so please try to be a little politer and everyone on this forum will be happy to help ;)

As for your question, you might want to use a system command to execute it. For deleting the file: http://www.cplusplus.com/reference/clibrary/cstdio/remove/ Isn't Google easy!
Last edited on
Topic archived. No new replies allowed.