If it's not recognized by your compiler, I highly question whether you're using a good compiler. That being said, an alternative to system() would most likely be system-specific. Are you using a Windows, Mac, Linux or any other computer?
Honestly, why can't i find anything about this anywhere? It's such a simple freaking task... The BASIC language can run a program, why can't C++? Is there a library i need to add to my code or somthing?
I have no idea if this will work for a batch file because if my understanding is correct you run batch files through the command prompt. This would be more apt for reading in data.
yes, you can execute batch commands, but batch files should be able to run through a C++ program. Not to mention, even though that was a very nice I/O lesson, it doesnt include how to execute a batch file.
I've been re-posting the last post to bump it up (after being completely knocked off the page) in hopes of my questiong being answered by someone.
Well, don't do that. Your multiple threads don't stop existing just because they're not longer on the first page. By starting new ones you break the continuity for anyone who's replied.
SYSTEM DOESNT WORK, like SYSTEM(ANYTHING) doesnt work
system() (all lower case) does work, and is in fact the only standard way of making command line calls.
Little piece of advice: when you ask something, don't just sit on your hands waiting for someone to find a solution for your problem. It takes 10-20 minutes of research to find out how to do this. You would have had your answer five days ago if you had only taken the trouble of looking around a bit. http://www.cplusplus.com/reference/
YOU ARE WRONG. I found the solution by myself. You know what it is? Take a guess...
IT NEEDS TO INCLUDE #include <windows.h> AS A HEADER. And then the system( code ) command will work. why didnt anyone say this? oh well, only took 2 weeks..... :|
i did a searches, and it only took 2 entire weeks for me to find that you have to have a header to use system() becuase no one ever mentions that you have to have a header to use the system() command. If i could've found it on Google, i would not have posted this, becuase, lets be honest with ourselves, it woulda been a lot easier now, wouldn't it have?
You would have known that if you had taken the time to read any book on C or C++ for a few hours.
no one ever mentions that you have to have a header to use the system() command
There's a limit to how much we're going to assume that you don't know.
If someone gives you code and it doesn't work, rather than, say, ignoring the answer or starting a new thread for the same question, reply "what you wrote doesn't work for me" followed by a a description of what's not working, like "the compiler gives me these errors: <error messages>", or "the program crashes at line x", or "the program outputs y but should output z". We're here to help, but -- I'll say it again -- we can't and won't do everything for you. Answering questions requires energy from both parties.