To tylko jedna z 2 stron tej notatki. Zaloguj się aby zobaczyć ten dokument.
Zobacz
całą notatkę
Problems with References Problems: - when the actual parameter type is not the same as formal - … or is an expression: char c=1, int a=2, int b=3; swap(a, c); swap(a+1, b); arguments are converted to const (const int), compiler expects int (not const) it should exit with error, usually issues only a warning // int &r1=8; // ERROR! 8 is constant const int &r2=7, // OK &r3=a+b; // OK /* r2 and r3 - references to constant temporary objects */
... zobacz całą notatkę
Komentarze użytkowników (0)