fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class L {
  5. public:
  6. int *tab;
  7. int size;
  8. L (int rozmiar) {
  9. tab = new int[rozmiar];
  10. size = rozmiar;
  11. }
  12. };
  13.  
  14. L* Wczytaj() {
  15. return new L(5);
  16. }
  17.  
  18. L WczytajBez() {
  19. return L(10);
  20. }
  21.  
  22. int main() {
  23. L *nowyObiekt = Wczytaj();
  24. cout << nowyObiekt->size;
  25. L Obiekt = WczytajBez();
  26. cout << Obiekt.size;
  27. return 0;
  28. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
510