Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What is a virtual destructor? Why is it needed?
- Not sure - I'd guess something that tears down an object in memory and frees its resources, but I'm not sure what the virtual keywork is or why it's needed. Google ho!
- What does the class template shared_ptr do? What is its purpose?
- Not sure - I'd assume templates are generics related (or maybe inheritance?), so maybe it allows multiple classes to share a single pointer? Doesn't sound right, should be easier than that.
- What is a vector, and why would you use it?
- A vector is a resizeable array. You'd use it when you wanted had an unknown quantity of objects, and wanted quick access more than quick inserts or deletes.
- What is a map, and why would you use it?
- A map is a key/value storing. It's a data structure used for linking pairs of information.
- What are the differences between a reference and a pointer? When should each be used?
- Passing by reference as opposed to by value means that you're passing the location of the object in memory as opposed to a new copy of the object that is identical. Pointers are similar, pointing to the location in memory, but are easier to iterate with.
- What is an iterator, and when is it used?
- An iterator is a pointer to a data structure that can be used to access sequential data in it.
- What are the memory areas in a C++ program, and what is the purpose of each?
- No clue :\.
- When should a member function be const? What effect does this have?
- Const is like static in java. It means a variable can't be changed after initialization. Not sure what it does for functions, classes, etc. in c++.
- What is a copy constructor, and what is an assignment operator? When must you define them in a class?
- A copy constructor takes an existing object as an argument and makes a new version of it, duplicating its contents. I'm not sure when you must define them.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement