TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CHRIS ARMSTRONG
from: JONATHAN DE BOYNE POLLARD
date: 1998-01-30 11:42:00
subject: calling dos commands

 CA> Could anyone tell me how to call dos commands or executables 
 CA> from  within a program?? 
Strictly Correct Answer:  You cannot, since the C++ language doesn't require 
you to use DOS, and doesn't require that any form of external command be 
accessible.
With the proviso that you *are* using DOS: Almost all C++ compilers for DOS 
implement the Standard C++ library function system() so that it passes its 
argument to the command interpreter named by the COMSPEC environment 
variable.  Read your compiler's library reference manual for details of the 
system() function.
DOS implementations of the C++ language also provide the exec..() family of 
functions that are defined by the international standard ISO/IEC 9445-1:1993 
(a.k.a. "POSIX 1003.1"), and the analogous spawn..() family of functions.  
These too will be documented in your compiler's library reference manual.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.