Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. Aufpassen auf Datentypen -> unsigned int bzw char besser als int
  2. switch statt if else bei verschachtelten verzweigungen
  3. für arrays macros verwenden
  4. globale variablen sparen
  5. condition breakdown
  6.  
  7. cout vs printf
  8. funktionsaufrufe teuer, wenn funktion in schleife aufgerufen wird eher funktion mit einem parameter aufrufen, der dann schleife IN funktion durchführt
  9. Vergleich von zahlen ist schneller als einfacher check; zb !=0 schneller als <= n
  10.  
  11. Arrays:
  12. pointer arithmetik verwenden, statt index zugriff
  13. for(int* ptrInt = nArray; ptrInt< nArray+n; ptrInt++) *ptrInt=nSomeValue;
  14.  
  15. lokale variablen reduzieren
  16. funktionsparameter reduzieren
  17. strukturen pass by reference not by object
  18.  
  19. casten vermeiden
  20. For most classes, use the operators += , -= , *= , and /= , instead of the operators + , - , * , and / .For most classes, use the operators += , -= , *= , and /= , instead of the operators + , - , * , and / .
  21. For basic data types, use the operators + , - , * , and / instead of the operators += , -= , *= , and /= .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement