By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,484 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,484 IT Pros & Developers. It's quick & easy.

Subroutine should return a vector

P: n/a

Ladies, Gentlemen -

It's been about 3 years since I translated 68000 assembly language
code into 'C' and I remember that 'C' design model that I didn't
like. 'C', as I understand it, was supposed to be modeled after
a sort of mathematical function returning one item per function call
regardless of how many parameters were passed to the function;
sorta like this ;

w = f(a,b,c,d,e......)
returned value function call( parameters passed in )

I want to return the starting address of a list of returned
parameters. How do I set this up?

2Penny
Nov 7 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
2Penny wrote:
>
Ladies, Gentlemen -

It's been about 3 years since I translated 68000 assembly language
code into 'C' and I remember that 'C' design model that I didn't
like. 'C', as I understand it, was supposed to be modeled after
a sort of mathematical function returning one item per function call
regardless of how many parameters were passed to the function;
sorta like this ;

w = f(a,b,c,d,e......)
returned value function call( parameters passed in )

I want to return the starting address of a list of returned
parameters. How do I set this up?

2Penny
While only one value is returned directly by a function, that value can
be a struct object containing multiple members, each with it's own value..

Also, the arguments to the function can be pointers to other objects,
and the function can be used to set the values of the objects pointed at.

Both of these methods allow you "return" more than one thing from a C
function.
Nov 7 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.