Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication2.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <ctime>
- #include <string.h>
- #include <cstdio>
- #include <cstdlib>
- using namespace std;
- //Napisz funkcje void zamiana(int a, int b)
- //ktora zamienia wartosci parametrow
- //np :
- //przed a = 2, b = 5
- //po a = 5, b = 2
- void zamiana(int a, int b)
- {
- cout << a << ' ' << b << endl;
- cout << "------" << endl;
- int *wsk;
- int *wski;
- wsk = &a;
- wski = &b;
- int przenosny = *wsk;
- *wsk = *wski;
- *wski = przenosny;
- cout << a << ' ' << b << endl;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- //int liczba1 = 4;
- //int liczba2 = 10;
- //int *wskI;
- //wskI = &liczba1;
- //cout << "adres: " << wskI << " wartosc: " << *wskI << endl;
- //wskI = &liczba2;
- //cout << "adres: " << wskI << " wartosc: " << *wskI << endl;
- //cout << "liczba2: " << liczba2 << endl;
- //*wskI = 30;
- //cout << "liczba2: " << liczba2 << endl;
- //system("pause");
- //return 0;
- zamiana(20, 10);
- system("Pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement