ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] [JT] C function parameters order
@ 2005-08-18  8:36 Vitaly Ostanin
  2005-08-18  8:53 ` Andrew Borodin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Vitaly Ostanin @ 2005-08-18  8:36 UTC (permalink / raw)
  To: ALT Linux Community

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

Здравствуйте.

Тут прислали прикол:
#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

Кто из них не прав?

-- 
Regards, Vyt
mailto:  vyt@vzljot.ru
JID:     vyt@vzljot.ru


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-18  9:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-18  8:36 [Comm] [JT] C function parameters order 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

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