Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #164432
| From | Satan <satan@dot.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Is the output of this program compiler dependent? |
| Date | 2022-01-17 03:39 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ss2okf$i0l$1@gioia.aioe.org> (permalink) |
| References | <ss2nci$a2k$1@gioia.aioe.org> |
Sorry this was posted on the wrong newsgroup so I am posting it here!
On 17/01/2022 03:00, Satan wrote:
> I read somewhere that the parameters of functions are evaluated right >>
> to left but it all depends on the compiler. Therefore, does this mean
> that the output of this program is "undefined" meaning there is no
> definite answer!
>
> #include <stdio.h>
>
> void fun(int, int);
>
> int main()
> {
> int i = 5;
> fun(--i, i++);
> fun(++i, i--);
> printf("From Main: %d\n", i++);
>
> return 0;
> }
>
> void fun(int x, int y)
> {
> printf("From Function: %d %d\n", x++, y--);
> }
>
Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Is the output of this program compiler dependent? Satan <satan@dot.com> - 2022-01-17 03:39 +0000
Re: Is the output of this program compiler dependent? Richard Damon <Richard@Damon-Family.org> - 2022-01-16 23:19 -0500
Re: Is the output of this program compiler dependent? James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-16 23:24 -0500
Re: Is the output of this program compiler dependent? David Brown <david.brown@hesbynett.no> - 2022-01-17 08:46 +0100
Re: Is the output of this program compiler dependent? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-01-17 12:36 +0000
Re: Is the output of this program compiler dependent? David Brown <david.brown@hesbynett.no> - 2022-01-17 15:26 +0100
Re: Is the output of this program compiler dependent? Öö Tiib <ootiib@hot.ee> - 2022-01-17 08:04 -0800
Re: Is the output of this program compiler dependent? James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-17 15:51 -0500
Re: Is the output of this program compiler dependent? James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-17 15:52 -0500
csiph-web