Re: return() value
- From: Jack Klein <jackklein@xxxxxxxxxxx>
- Date: Thu, 11 Aug 2005 20:32:23 -0000
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.
.
- References:
- return() value
- From: #2pencil
- return() value
- Prev by Date: Re: switching on strings in standard C
- Next by Date: Re: return() value
- Previous by thread: Re: return() value
- Next by thread: Re: return() value
- Index(es):
Relevant Pages
|