Gentoo Archives: gentoo-user-de

From: Felix Schuster <felix.schuster@×××.at>
To: gentoo-user-de@l.g.o
Subject: Re: [gentoo-user-de] [OT] C++-Formalismus
Date: Sat, 06 Jan 2007 00:47:47
Message-Id: 1168044382.5515.3.camel@localhost
In Reply to: Re: [gentoo-user-de] [OT] C++-Formalismus by Arnold Krille
1 Hey!
2
3 On Fri, 2007-01-05 at 17:38 +0100, Arnold Krille wrote:
4 > Interessant ist das oben genannte Konstrukt eigentlich nur als:
5 >
6 > int i=0, j;
7 > j = i++;
8 >
9 > Welchen Wert j da hat bzw. haben sollte, weiß ich nicht...
10
11 Wie Eckard das Beispiel anhand von k ausführt -> j wird 0 zugewiesen.
12 Im Gegensatz zu
13
14 int i=0,j;
15 j=++i;
16
17 Hier wird i zuerst um eins erhöht, erst dann findet die Zuweisung statt.
18
19 Wer's nicht glaubt, probiere es selbst:
20 1 #include <stdio.h>
21 2
22 3 void main()
23 4 {
24 5 int i=0,j;
25 6 j=++i;
26 7 printf("i=%i:j=%i\n",i,j);
27 8 }
28
29 bye, Felix
30 --
31 Felix Schuster <felix.schuster@×××.at>
32 Vienna, Austria

Attachments

File name MIME type
signature.asc application/pgp-signature