Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int i = 40;
- int j = 21;
- int *p;
- int *q;
- p = &i;
- q = &j;
- cout << "--- Ausgabe nach Teilaufgabe a) ---" << endl;
- cout << "\t\tAdresse\t\tInhalt\trefernzierter Wert " << endl;
- cout << "Variable i \t" << &i << "\t" << i << endl;
- cout << "Variable j\t" << &j << "\t" << j << endl;
- cout << "Zeiger p\t" << &p << "\t" << p << "\t" << *p << endl;
- cout << "Zeiger q\t" << &q << "\t" << q << "\t" << *q << endl << endl;
- p = &j;
- q = &i;
- cout << "--- Ausgabe nach Teilaufgabe b) ---" << endl;
- cout << "\t\tAdresse\t\tInhalt\trefernzierter Wert " << endl;
- cout << "Variable i \t" << &i << "\t" << i << endl;
- cout << "Variable j\t" << &j << "\t" << j << endl;
- cout << "Zeiger p\t" << &p << "\t" << p << "\t" << *p << endl;
- cout << "Zeiger q\t" << &q << "\t" << q << "\t" << *q << endl << endl;
- *q +=2;
- cout << "--- Ausgabe nach Teilaufgabe d) ---" << endl;
- cout << "\t\tAdresse\t\tInhalt\trefernzierter Wert " << endl;
- cout << "Variable i \t" << &i << "\t" << i << endl;
- cout << "Variable j\t" << &j << "\t" << j << endl;
- cout << "Zeiger p\t" << &p << "\t" << p << "\t" << *p << endl;
- cout << "Zeiger q\t" << &q << "\t" << q << "\t" << *q << endl << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement