Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Aufpassen auf Datentypen -> unsigned int bzw char besser als int
- switch statt if else bei verschachtelten verzweigungen
- für arrays macros verwenden
- globale variablen sparen
- condition breakdown
- cout vs printf
- funktionsaufrufe teuer, wenn funktion in schleife aufgerufen wird eher funktion mit einem parameter aufrufen, der dann schleife IN funktion durchführt
- Vergleich von zahlen ist schneller als einfacher check; zb !=0 schneller als <= n
- Arrays:
- pointer arithmetik verwenden, statt index zugriff
- for(int* ptrInt = nArray; ptrInt< nArray+n; ptrInt++) *ptrInt=nSomeValue;
- lokale variablen reduzieren
- funktionsparameter reduzieren
- strukturen pass by reference not by object
- casten vermeiden
- For most classes, use the operators += , -= , *= , and /= , instead of the operators + , - , * , and / .For most classes, use the operators += , -= , *= , and /= , instead of the operators + , - , * , and / .
- For basic data types, use the operators + , - , * , and / instead of the operators += , -= , *= , and /= .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement