Advertisement
modlicha

wskaźniki + jakiś tam struckt

Jan 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. int a = 4;
  8. double b;
  9. bool ok[10];
  10. int arr[10] = {0,1,2,3,4,5,6,7,8,9};
  11.  
  12. struct point
  13. {
  14. float x;
  15. float y;
  16. };
  17.  
  18. point A;
  19.  
  20. cout << sizeof(a) << endl;
  21. cout << &a << endl;
  22. cout << sizeof(b) << endl;
  23. cout << &b << endl;
  24. cout << sizeof(ok) << endl;
  25. cout << &ok << endl;
  26. cout << sizeof(arr) << endl;
  27. cout << &arr << endl;
  28. cout << sizeof(A) << endl;
  29. cout << &A << endl;\
  30. cout << &A.x << endl;
  31. cout << &A.y << endl;
  32.  
  33. int d = 3;
  34. int *ptr_d = NULL; //wskaznik
  35. ptr_d = &d;
  36. cout << *ptr_d << endl;
  37. d += 1;
  38. cout << *ptr_d << endl;
  39. cout << *ptr_d + 1 << endl;
  40. cout << *(ptr_d + 1) << endl;
  41. cout << *(ptr_d - 1) << endl;
  42. cout << *arr << endl;
  43.  
  44. for (int i=0; i<10; i++)
  45. cout << *(arr + i) << endl;
  46. cout << "SuPeR FaJnA LeKcJyJkA" << endl;
  47.  
  48. return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement