ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Damir Shayhutdinov <damir@tecon.ru>
To: ALT Linux Community <community@altlinux.ru>
Subject: Re: [Comm] [JT] C function parameters order
Date: Thu, 18 Aug 2005 12:59:38 +0400
Message-ID: <43044DFA.2030207@tecon.ru> (raw)
In-Reply-To: <43044893.3000909@vzljot.ru>

Vitaly Ostanin пишет:

>Здравствуйте.
>
>Тут прислали прикол:
>#include <stdio.h>
>void test(int a, int b, int c, int d)
>{
>printf("a=%d, b=%d, c=%d, d=%d\n", a ,b, c, d);
>}
>void main(void)
>{
>int c = 1;
>test(++c, ++c, ++c, ++c);
>test(c++, c++, c++, c++);
>printf("\nc=%d\n", c);
>}
>
>gcc-3.4.4 и борландовский turbo C 2.0.1 говорят:
>a=5, b=4, c=3, d=2
>a=8, b=7, c=6, d=5
>
>c=9
>
>А MS visual C 6.0 говорит:
>a=5, b=4, c=3, d=2
>a=5, b=5, c=5, d=5
>
>c=9
>
>Кто из них не прав?
>  
>
ЕМНИП, стандартом поведение не определено. Так что неправ только 
программист.

      parent reply	other threads:[~2005-08-18  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-18  8:36 Vitaly Ostanin
2005-08-18  8:53 ` Andrew Borodin
2005-08-18  9:22   ` [Comm] " Vitaly Ostanin
2005-08-18  8:57 ` [Comm] " Alexey V. Novikov
2005-08-18  8:59 ` Damir Shayhutdinov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43044DFA.2030207@tecon.ru \
    --to=damir@tecon.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git