Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

31

23.05.2008, 16:48

Steht da auch irgendwas, das man die Summanden vertauschen darf. Vorsicht: nicht ueberall darf man das, vielleicht isses hier ja auch der Fall.

dot

Supermoderator

Beiträge: 9 757

Wohnort: Graz

  • Private Nachricht senden

32

23.05.2008, 16:56

Zitat von »"C++ Standard 2003 §5.2.1"«

One of the expressions shall have the type ``pointer to T'' and the other shall have enumeration or integral type. The result is an lvalue of type ``T.''


da steht schonmal dass es egal ist was zuerst kommt.

Zitat von »"C++ Standard 2003 §5.2.1"«

The expression E1[E2] is identical (by definition) to *((E1)+(E2))


Zitat von »"ISO C++ Standard 2003 §5.7 Absatz 5"«

In other words, if the expression P points to the i-th element of an array object, the expressions (P)+N (equivalently, N+(P)) and (P)-N (where N has the value n) point to, respectively, the i+n-th and i–n-th elements of the array object, provided they exist.


und daraus folgt dass es kommutativ ist...

ich hoffe das reicht dir an quellen ;)

33

23.05.2008, 17:04

Ja, ueberzeugt. Wieder was gelernt!

Es gibt da noch so andere Sachen:

Zitat


Therefore, despite its asymmetric appearance, subscripting is a commutative operation.


edit: Um die Wette editieren ^^.

Werbeanzeige