hmm it sounds to me, (although I could be mistaken), you are trying to emulate the *command prompt* in c++.
That in itself is a mammoth task. The code provided merely, allows you to view the contents of a directory, nothing else such as copy files or other stuff you would do in the *command prompt*.
What's wrong with actually using the *command prompt* anyway?
However, if you are dead set on using this in c++ your best bet is to try using *system*.
For example, in *command prompt* to view the memory you would type.
>>mem
To emulate this, and all other command prompt commands, you might do:
Code:
#include <iostream>
using namespace std;
int main()
{
system("mem");
system("pause");
}
However,using system has it's draw backs in itself as you are probably well aware of, and the code is compiler and operating system dependent.