Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // UWAGA: funkcja nie modyfikuje zmiennej przekazywanej do funkcji!
- // funkcja pobiera wartość zmiennej, a nie samą zmienną!
- void wypisz(int liczba)
- {
- cout << liczba << endl; // 2. 10
- ++liczba;
- cout << liczba << endl; // 3. 11
- }
- int main()
- {
- int liczba = 10;
- cout << liczba << endl; // 1. 10
- wypisz(liczba);
- cout << liczba << endl; // 4. 10
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement