Advertisement
Chieffo

tworzenie zmiennych dynamicznych

Sep 22nd, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a,b,c;
  8. /*tworzenie zmiennych dynamicznych*/
  9.  
  10. int *wa= new int;/*polecenie tworzenia zmiennej dynamicznej*/
  11.  
  12. int *wb= new int;/*polecenie tworzenia zmiennej dynamicznej*/
  13.  
  14. *wa=10;
  15. *wa+=5;/*wartość wa= a+5*/
  16. (*wa)++;/*wartość + 1*/
  17. *wb=*wa;/*wart b = wart a*/
  18. delete wa;
  19. cout<<*wb;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement