One quick question... how can I invoke some DOS commands from a C++ program ? Say I wanna do a "dir" or call some other executable from my C++ program. Is it possible ? How ?
Thanks.
One quick question... how can I invoke some DOS commands from a C++ program ? Say I wanna do a "dir" or call some other executable from my C++ program. Is it possible ? How ?
Thanks.
#include <cstdlib>
int main()
{
System("dir"); // i forget if it is S or s in system on windows
return 0;
}
system not System
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Thanks a lot ! That works ! But what if I wanna use the results for "dir" in my program ? Like how would I store a list of all the files and dirs in my program and then use it for some processing ?