• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Dos Commands in C++

I have a program that i am writing and I want to include DOS commands in the code but when i compile it gives me an error. Do i have to have a certain header file or what. Im completely stumped. I am using DEV C++ and Borland Turbo C++. I just write out the command directly.I am on a PC running Win98. This is a dos program running in Windows. Some of the errors say stray "/" in program. I use the <stdlib.h> also.
0
Unreal7000
Asked:
Unreal7000
  • 4
  • 3
1 Solution
 
chensuCommented:
What function are you using to call DOS commands? Are you writing Windows programs? What platform? What compiler are you using? What error do you get? ...

If you are using the C Run-time Library function system, you need to include <stdlib.h>.
0
 
Unreal7000Author Commented:
i just write out the dos command directly. These programs are dos run, but can be run in windows, I am using Dev C++ and Borland Turbo C++. I get just a bunch of errors.
0
 
Unreal7000Author Commented:
Edited text of question.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Unreal7000Author Commented:
Edited text of question.
0
 
Unreal7000Author Commented:
Edited text of question.
0
 
chensuCommented:
Use the C Run-time Library function system. For example,

system("dir c:\\");
0
 
chensuCommented:
By the way, please add comments instead of editting the original question once the thread starts so that it is easy for us to follow.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now