Varasku

Wczytanie zmiennej przez wskaźnik

Apr 10th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(int argc, char** argv) {
  6.  
  7. int a = 10;
  8. int* b = new int;
  9. *b = 22;
  10. cout<<"a ="<< a << endl;
  11. cout<<"adres b ="<< b << endl;
  12. cout<<"b ="<< *b << endl;
  13. delete b;
  14.  
  15.  
  16.  
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment