This sequence container behaves like a dynamic array, automatically resizing itself when elements are added or removed.
What is, std::vector?
What a function takes in.
What is a parameter / argument?
The code for a loop that "never" ends.
What is, while(true)?
Public, Protected, Private
What are, access specifiers?
#include <iostream>
int main(){
std::cout << "Hello World"
return 0;
}
What is, missing a ";" on the 3rd line?
This is the specific standard library header file you must include to work with file streams such as ifstream and ofstream.
What is, <fstream>?
___ function() {}
^^^
What is, a return type?
This keyword is used to immediately exit and terminate a loop.
What is, break?
The difference between a class and struct.
What is, default access? (class is private, struct is public)
#include <string>
#include <iostream>
int returnName() {
std::string name;
std::cin >> name;
return name;
}
What is, incorrect return type!
What Sonny says every time we discuss maps.
What is, key-value pairs?
A function that calls itself to solve smaller instances of the same problem.
What is, a recursive function?
In C++ conditional statements (like an 'if' statement), any non-zero number is treated as 'true', while this specific integer evaluates to 'false'.
What is, 0?
The OOP concept of bundling data and the methods that operate on them into a single unit (class), while hiding internal details.
What is, encapsulation?
#include <vector>
int main() {
std::vector<char> vec = {'a','b','c'};
vec.delete('b');
return 0;
}
What is, incorrect vector function!
This C++ keyword is used to signal the occurrence of an anomalous or exceptional condition, passing an object to the nearest exception handler.
What is, throw?
he C++ feature that allows multiple functions to share the same name but have different parameters.
What is, overloading?
nstead of terminating a loop, this keyword immediately skips the remaining code in the current iteration and jumps directly to evaluate the next loop cycle.
What is, continue?
The mechanism by which one class acquires the properties and behaviors (data and methods) of another class.
What is, inheritance?
class Obj{
public:
int num;
}
int main() {
Obj* heapObj = new Obj;
heapObj.num =5;
return 0;
}
What is, incorrect access operator OR memory leak?
This is the standard C++ base class from which all standard library exception classes (like std::runtime_error) inherit, containing the virtual member function what()
What is, std::exception?
A member function declared with this keyword in a base class can be overridden in a derived class.
What is, virtual?
The syntax for C++'s version of a for-each loop.
What is,
for(const auto& element : list)
The ability of different classes to respond to the same function call in their own unique way, often implemented via virtual functions.
What is, polymorphism?
int returnArr() {
int array[5];
return array;
}
int main() {
int array = returnArray();
return 0;
}
What is, passing stack array between functions!