🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #1970

Re: returning multiple values in C

#1970
From: Andrew Hamilton-Wright
Date: Thu, 15 Feb 1996 03:09
31 lines
1782 bytes
In article <4fst42$2e5@solutions.solon.com>,
Herman Rubin (hrubin@stat.purdue.edu) was heard to say:

 [ my previos post deleted ]

>Even here, there may be many reasons for NOT putting them in
>a struct.  One would be if one is dividing a multiple word
>integer by a single word one; in that case, the quotient
>goes into the return area, and the remainder becomes the
>most significant part for the next step.

I am confused here -- if both of these are part of the
return 'type', then they will pretty much be travelling
together on the stack, except in cases where the return
values are held in registers.   I am not sure what you
are referring to by 'the next step' (unless you are
referring to some sort of static local storage?)


>But it is also the case that the two parts are not of the
>same numerical type.  For example, unpacking floats gives
>a short integer and a mantissa, for which the type may also
>be variable, depending on what one wants to do with it.
>But the exponent and mantissa are unlikely to be wanted
>in the same "unit".

This is a valid point.


--
    andrew@snowhite.cis.uoguelph.ca          andrewhw@uoguelph.ca
Technical Details
Message-ID: <4fu85n$9gb@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4fa7gv$2te@solutions.solon.com> <4fjndv$ore@solutions.solon.com> <4fm9fi$53a@solutions.solon.com> <4fp1jm$h53@solutions.solon.com> <4fst42$2e5@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: andrewhw@uoguelph.ca (Andrew Hamilton-Wright)
Newsgroups: comp.lang.c.moderated
Subject: Re: returning multiple values in C
Date: 14 Feb 1996 21:09:43 -0600
Organization: University of Guelph
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4fu85n$9gb@solutions.solon.com>
References: <4fa7gv$2te@solutions.solon.com> <4fjndv$ore@solutions.solon.com> <4fm9fi$53a@solutions.solon.com> <4fp1jm$h53@solutions.solon.com> <4fst42$2e5@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: TIN [version 1.2 PL2]