Basic C++ Interview Question and Answers
11. |
How many types of variable scopes are there? |
|
Scope refers to the accessibility of a variable. There are four types of scopes in C++.- Local scope
- File scope
- Function scope
- Class scope
|
|
|
12. |
What is an assignment operator? |
|
An assignment statement, assigns value on the right hand side of an expression to the variable on the left hand side of the assignment operator.= is the assignment operator. |
|
|
13. |
How is polymorphism achieved? |
|
Polymorphism is achieved through function overloading and operator overloading. |
|
|
14. |
What is break statement? |
|
A loop's execution is terminated when the test condition evaluates to false. Under certain situations one desires to terminate the loop, irrespective of the test expression. |
|
|
15. |
What is an operator and an operand? |
|
Operator specifies an operation to be performed that yields a value.
An operand is an entity on which an operator acts.
|
|
|