using dos commands in c++

ajeetbharath used Ask the Experts™
i learnt using yhe dos commands in the
program itself by using the int system(char *p)
function from the process.h header file.
but i get an error saying that
there is not enough memory.(ENOMEM error vlue in 'errno')
i get the same error when i use the spawn function
by putting the cmd's value as P_WAIT.
but not when i give the value as P_OVERLAY.
my operating system is win xp proffessional
does that also matter?because i recieved i symultaneous error from the system via GUI.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Are trying to spawn children processors because it looks like code for either Shared Memory or MPI? Can you post specific code so I can see where the error might be?
Try using system("pause") commmand after you give your command.
This will pause the DOS display, and give you time to examine exactly what is going on.


i got the answer myself


i had already told what error i had encountered
but still asked me to give a pause.
any way i got it myself.

It's normally customary to give an 'A' grade to most questions.

Sorry ajeetbharath, but I do not give further assistance to questioners that give me a 'C' grade.  That ruins my statistics.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial