Commit 18708ab7 by Szeberényi Imre

kiirasok jav

parent 4a9c0446
...@@ -16,22 +16,37 @@ using std::endl; ...@@ -16,22 +16,37 @@ using std::endl;
struct Valami { struct Valami {
Valami() { cout << "HAHO megszulettem!" << endl; } Valami() { cout << "HAHO megszulettem!" << endl; }
~Valami() { cout << "Jaj, itt a kaszas!" << endl; } ~Valami() { cout << "JAJ, vegem van!" << endl; }
}; };
int main() { int main() {
cout << "1." << endl; int db = 0;
cout << ++db << ". ";
Valami o1; Valami o1;
cout << "2." << endl; cout << ++db << ". ";
Valami o2; Valami o2;
cout << "3." << endl; cout << ++db << ". (new) ";
Valami *o3 = new Valami; Valami *o3 = new Valami;
cout << " (delete) ";
delete o3; delete o3;
cout << "--- blokk elott: ---\n";
{
cout << ++db << ". ";
Valami o1;
}
cout << "--- blok utan: ---\n";
#ifdef _FOR #ifdef _FOR
for (int i = 0; i < 5; i++) cout << "--- For indul ---" << endl;
for (int i = 0; i < 5; i++) {
cout << ++db << ". ";
Valami o1; Valami o1;
}
cout << "--- Vege ----" << endl;
#endif // _FOR #endif // _FOR
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment