Introduction to CPP
8 important questions on Introduction to CPP
Where are functions and classes usually declared?
Where are functions and classes defined?
Headers let the compiler, and you!, know the (1) of the functions you will use, which can be (2) in other “.cpp” files, or in libraries.
Fill in the words at (1) & (2)
- type (declaration)
- defined
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
Should file names match? (.h & .cpp)
How many times may a header file be included? And how to avoid more?
How are namespaces declared and used?
The namespace can then be used as follows: NiceName::functionA()
What should be placed after the closing bracket of a class definition?
How to do a call-by-reference and a call-by-value?
The call-by-reference can be done by adding a & after the variable type (e.g. int&), meaning that the new value of the variable is referenced, to another variable's place in memory. Changing reference variable A also changes referenced variable B.
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding