--- Michael Fratoni <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sunday 26 January 2003 01:12 pm, exits funnel > wrote: > > Hello, > > > > I've written the following simple program: > > > > #include <cstdlib> > > > > int main( ) > > { > > // /fff does not exist > > int return_value = system("ls -l /fff"); > > cout << "\n Return Value: " << return_value << > "\n"; > > return return_value; > > } > > > > When I compile this and run it from bash I see > "Return > > Value: 256" at stdout as I'd expect. However, I > then > > immediately 'echo $?' and bash spits back '0' > rather > > than '256.' Is this correct? Shouldn't $? hold > the > > return value of the last program run from bash > (ie, my > > c program?) Thanks in advance for any replies. > > I'm not a coder. That doesn't stop me from trying, > though. ;) > > I can't even make the above code compile here. > (Red Hat 8.0, gcc-3.2) > $ g++ -o return return.cpp > return.cpp: In function `int main()': > return.cpp:7: `cout' undeclared (first use this > function)
Oops, I entered the code into my mail from memory and forgot: #include <iostream> In any case, you're right, anything beyond eight bits are ignored. Thanks a lot. -exits __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list