Looking for Course 15873 test answers and solutions? Browse our comprehensive collection of verified answers for Course 15873 at edu.vik.bme.hu.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Igaz, vagy hamis? Az STL minden sorozattárolójának van iterátoros konstruktora.
Igaz, vagy hamis? A destruktor nem lehet virtuális.
Mit ír ki a következő kódrészlet?
#include <iostream>void f(char x) { std::cout << "c"; }void f(int x) { std::cout << "i"; }void f(double x) { std::cout << "d"; }
int main() { f(1.0);}
Mi lesz az alábbi kódrészlet lefutása után ch értéke?
const char* duma = "Hello9";std::vector<char> t(duma, duma+6);char ch = *t.rbegin();
Igaz, vagy hamis? Többszörös öröklés esetén az alaposztály mindig virtuális.
A const_iterator értéke megváltoztatható, csak az adat nem változtatható meg, amire az iterátor hivatkozik.
Hányszor hívódik meg az alábbi C++ programban a Pont osztály destruktora ?
struct Pont { int x; int y; };void foo(Pont& a) {
a.x = a.y;
}
int main() {
Pont p1;
foo(p1);
}
Védett-e a memóriaszivárgástól az alábbi program, ha a function() függvényben kivétel keletkezhet, és máshol memóriát nem foglalunk?
struct Foo { int* array; Foo(int* array) : array(array) { } ~Foo() { delete[] array; }};int main() { try { int* ptr = new int[100]; Foo foo(ptr); function(); } catch (...) { std::cout << "Jaj"; } return 0;}
Igaz, vagy hamis? A static_cast operátor a static minősítő eltávolítására/hozzáadására használható.