Saturday, May 22, 2010

More C++ help please?

Two questions.





1. How do I take arguments in C++


2. I have this code (which is directrun):


#include %26lt;iostream%26gt;


#include %26lt;string%26gt;


using namespace std;





int main(char* argv[]) {


system(argv[0]);


return 0;


}





It compiles successfully but when I run it with:


directrun cls





A window pops up telling me that DirectRun.exe has stopped working. Help please?

More C++ help please?
argv[0] is "directrun"


argv[1] is "cls"





use system(argv[1]) for your clear screen


No comments:

Post a Comment