Skip to content
Snippets Groups Projects
Commit fe521ba6 authored by Marek Štrympl's avatar Marek Štrympl
Browse files

j

parent fac77a66
Branches main
No related tags found
No related merge requests found
*
!*.*
!*/
\ No newline at end of file
!*.cpp
\ No newline at end of file
No preview for this file type
......@@ -2,14 +2,16 @@
class myClass
{
static int count;
public:
static int count;
int value;
myClass() {
count++;
value = 10;
std::cout << "Created\n";
}
myClass(int val) {
count++;
value = val;
std::cout << "Created\n";
}
......@@ -18,11 +20,14 @@ class myClass
}
};
int myClass::count = 0;
int main()
{
int Marek = 0;
myClass a;
std::cout << "Instanci " << myClass::count << std::endl;
myClass *c = new myClass(5);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment