Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Home » Tip Bank » C++
Language: C++
Expertise: Beginner
Dec 1, 1999

Returning a Value

Question:
When executing a system call, how can I return a value back? My program will already return a value back.

Example:

String blah = system("some command");

Is this correct?

Answer:
No, the system() function returns a code that indicates whether the invocation of the command shell was successful (0 indicates success). However, it doesn't return the status of the program it executes. For that purpose, you need more advanced techniques such as sockets, files, or signals, depending on the platform you're using.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date