Mail Archives: djgpp/1996/08/05/12:48:27
Errors-To: postmaster AT ns1
From: j DOT aldrich6 AT genie DOT com
Date: Fri, 2 Aug 96 23:29:00 UTC 0000
Cc: djgpp AT delorie DOT com
X-Genie-Qk-From: J.ALDRICH6
X-Genie-Qk-Id: 7658497
X-Genie-Gateway-Id: 312996
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Content-Length: 494
Reply to message 9471561 from LAV AT VIDEO DOT YAR on 08/02/96 1:06PM
>> > Almost, actually there is a third valid definition for main():
>> >
>> > int main( int argc, char **argv, char **environment )
>
>This is not a valid definition (at least not standard). It is used in
>borland c, though.
I always thought that you could just get environment vars using
getenv(). Why add an extra complication to program initialization,
even if it is valid?
Does the above even work under DJGPP?
It definitely works in GCC in general. I see no reason why DJ et al. should
have broken this feature, though I have not used it in DJGPP myself.
Admittedly this feature has limited value as you only have access to the
arguments to main() in main() while getenv() is available anywhere. I do not
tend to use the third argument to main() myself for this reason, but the point
was just to point out that there were not "Only two valid declarations" for
main(), there is a third one, which is, though eminently usable, not
particularly useful.
--
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com
A proverb is no proverb to you 'till life has illustrated it. -- John Keats
- Raw text -