Advertisement
pVinc

tablicewklasach.cc

Jan 18th, 2020
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. // to z lenistwa xd
  4. #define tab a.tablica
  5. #define nl <<endl
  6.  
  7. using namespace std;
  8.  
  9. class Nowaklasa {
  10.         public:
  11.                 int *tablica; // jest w publicu bo ze mnie leber
  12.                 Nowaklasa(size_t tablicaSiz){
  13.                         tablica = new int[tablicaSiz];
  14.                 }
  15. };
  16.  
  17. int main(void){
  18.         Nowaklasa a(2);
  19.         a.tablica[0] = 1;
  20.         a.tablica[1] = 2;
  21.  
  22.         cout << tab[0] nl;
  23.         cout << tab[1] nl;
  24.  
  25.         return 0;
  26. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement