Skip to content

Instantly share code, notes, and snippets.

@senpl
Created September 12, 2022 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save senpl/3014a49e45a52e065e12904c2d4b546a to your computer and use it in GitHub Desktop.
Save senpl/3014a49e45a52e065e12904c2d4b546a to your computer and use it in GitHub Desktop.
Obiekty podczas tworzenia i usuwania
Stwórz klasę z konstruktorem i destruktorem.
Niech klasa ma globalny licznik ilośc_obiektow.
Niech konstruktor ustawia pole name i zwiększy ilosc_obiektow o 1.
Niech destruktor ustawia na obiekcie name usuniete a ilosc_obiektow zmniejsza o 1.
Niech w programie zostaną utworzone 5 obiektów potem 2 usunięte.
Na koniec wypisz ilosc_obiektow na konsole.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment