Re: Quick Question
From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 02/03/04
- Next message: Vivi Orunitia: "Re: std::container::iterator vs std::container::pointer"
- Previous message: NKOBAYE027: "Design Patterns Advice And Resources"
- Maybe in reply to: Victor Bazarov: "Re: Quick Question"
- Next in thread: Carter: "Re: Quick Question"
- Reply: Carter: "Re: Quick Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 03 Feb 2004 19:59:03 GMT
"Carter" <cjcastor@phreaker.net> wrote in message
news:b7fc5708.0402031127.4d338b09@posting.google.com...
> How do you make the output of a c++ program be interpreted as a UNIX
> command? Example, what would a program that executed ls look like?
#include <cstdlib>
#include <iostream>
int main()
{
int status = EXIT_SUCCESS;
if(system(NULL))
system("ls");
else
{
std::cerr << "Command processor not available\n";
status = EXIT_FAILURE;
}
return status;
}
-Mike
- Next message: Vivi Orunitia: "Re: std::container::iterator vs std::container::pointer"
- Previous message: NKOBAYE027: "Design Patterns Advice And Resources"
- Maybe in reply to: Victor Bazarov: "Re: Quick Question"
- Next in thread: Carter: "Re: Quick Question"
- Reply: Carter: "Re: Quick Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]