Skip to content
Snippets Groups Projects
Commit c8b7904f authored by Vojtěch Novotný's avatar Vojtěch Novotný
Browse files

update

parent 789a4537
No related branches found
No related tags found
1 merge request!2DU
......@@ -5,10 +5,12 @@ class TridaA
// atributy (data)
// metody(funkce)
public:
static int count;
int hodnota;
TridaA(int x)
{
count++;
hodnota = x;
std::cout << "Konstruktor TridaA2\n";
}
......@@ -23,6 +25,7 @@ public:
}
};
int TridaA::count = 0;
struct TridaB
{
};
......@@ -30,9 +33,12 @@ struct TridaB
int main()
{
TridaA a, b(5);
std::cout << "count = " << TridaA::count << std::endl;
TridaA *c = new TridaA(10);
std::cout << "count = " << TridaA::count << std::endl;
std::cout << "a.hodnota = " << a.hodnota << std::endl;
std::cout << "b.hodnota = " << b.hodnota << std::endl;
std::cout << c->hodnota << std::endl;
......
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