Re: return() value



On Sat, 06 Aug 2005 07:32:47 -0000, "#2pencil"
<number2pencil@xxxxxxxxx> wrote in comp.lang.c.moderated:

> I'm trying to get the return value from one program to another. Is
> this possible?
>
> -#2pencil-

It depends on exactly what you mean by "return value" and "one program
to another".

The C virtual machine does not really support the concept of multiple
programs of simultaneous execution. The one and only way C allows for
the possibility of a C program causing something else to execute is by
using the system() function from <stdlib.h>. The actual value of the
string you pass to system(), and whatever happens because of that
string, are completely implementation-defined.

If you mean have a second program retrieve the value returned from
main() by another, there is no guarantee that the system() function
can or will do that.

On possibility is to have one program write some value to a file, and
the other program opens the file and reads that value.

If this doesn't tell you what you want, you need to post again and use
more words, explaining exactly what it is that you are trying to
accomplish.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
--
comp.lang.c.moderated - moderation address: clcm@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
.



Relevant Pages

  • SUMMARY: inserting a blank line in a file
    ... Newsgroups: comp.unix.shell ... Lines that don't contain the string can go straight into the new file. ... > I've been trying various sed commands to no avail. ... RichGlazier@netscape.net wrote: ...
    (Tru64-UNIX-Managers)
  • Re: Help required in VS.Net Crystal Report
    ... Look for newsgroups with either the ... > I'm new to VS.Net Crystal Report. ... > Ptid String ... > Prid String ...
    (microsoft.public.vb.general.discussion)
  • Re: Test
    ... "other" discussions that frequent these groups; especially the foul language ... when I first found out about newsgroups and then I lurked for months before ... > My contention is doing a test is a lesser violation than some of the ... a string of messages not related to Windows of any version. ...
    (microsoft.public.windowsxp.general)
  • Re: Opening files according to extension
    ... "Carlos Chalhoub" wrote in message ... >> Please post any further questions or followup to the newsgroups for the ... >>> aTitle As String, aSubject As String, aAuthor As String, aCompany As ...
    (microsoft.public.word.vba.beginners)
  • Re: ok characters
    ... > newsgroups devoted exclusively to .NET programming. ... >> however I want to define the string of characters that AREN'T ok ... does the _tcscspn function have ...
    (microsoft.public.vb.general.discussion)