J
jayapal
Hi all,
Is there any way to return two values from a
function ....................
Thanks,
jayapal
Is there any way to return two values from a
function ....................
Thanks,
jayapal
Hi all,
Is there any way to return two values from a
function ....................
jayapal said:Is there any way to return two values from a
function ....................
--http://footstool.stanford.edu/~blp/private/out.jpeg
Richard Heathfield said:Ben Pfaff said:
Richly deserved. Congratulations!
Seconded.
What was the subject of your thesis ?
Seconded.
What was the subject of your thesis ?
Richard said:Ben Pfaff said:
Richly deserved. Congratulations!
Yes and no.
You can't do something like this:
int double foo(void)
{
int i = 5;
double d = 10.0;
return i d;
}
But you can do something like this:
struct bar1
{
int i;
double d;
};
struct bar1 foo1(void)
{
struct bar1 b;
b.i = 5;
b.d = 10.0;
return b;
}
In the above example you have created an instance of a struct, as a
local variable
inside a function. Will it not result in a run-time error when the
calling function tries to access the members of this struct and
the struct has actually vanished from the stack of the function
foo1() ???
In the above example you have created an instance of a struct, as a
local variable inside a function.
Indeed.
Will it not result in a run-time error when the
calling function tries to access the members of this struct and
the struct has actually vanished from the stack of the function
foo1() ???
In the above example you have created an instance of a struct, as a
local variable
inside a function. Will it not result in a run-time error when the
calling function tries to access the members of this struct and
the struct has actually vanished from the stack of the function
foo1() ???
Instead you can instance the struct bar1 in the calling function and
do
pass-by-reference instead !!!
... Also you will need to declare
the prototype for bar1 globally so that the foo1() can access it !!!
In the above example you have created an instance of a struct, as a
local variable
inside a function. Will it not result in a run-time error when the
calling function tries to access the members of this struct and
the struct has actually vanished from the stack of the function
foo1() ???
Charlie Gordon said:What was the subject of your thesis ?
Ben Pfaff said:Here is the thesis itself:
http://footstool.stanford.edu/~blp/private/thesis.pdf
I am most proud of chapter 2.
Thanks to everyone for the congratulations.
Here is the thesis itself:
http://footstool.stanford.edu/~blp/private/thesis.pdf
I am most proud of chapter 2.
Thanks to everyone for the congratulations.
Charlie Gordon wrote, On 30/10/07 07:39:
"The impact of hyper-pedants on programming." Why else has he been
hanging around here?
Congratulations Ben.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.