JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
C++ interview questions part 17
C++ interview questions part 17
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What are the disadvantages if use return keyword to return error codes?
A. protected
B. private
C. public
D. none of the mentioned
Show Correct Answer
Correct Answer is :
private
2. What is most suitable for returning the logical errors in the program?
A. initialize the objects
B. construct the data members
C. both initialize the objects & construct the data members
D. none of the mentioned
Show Correct Answer
Correct Answer is :
initialize the objects
3. What is the use of RAII in c++ programming?
A. 5
B. 10
C. Error
D. Segmentation fault
Show Correct Answer
Correct Answer is :
Error
4. How many levels are there in exception safety?
A. A.value
B. A::value
C. A->value
D. A^value
Show Correct Answer
Correct Answer is :
A::value
5. Pick out the correct statement for error handling alternatives.
A. Using a special keyword object
B. Using this pointer
C. Using * with the name of that object
D. By passing self as a parameter in the member function
Show Correct Answer
Correct Answer is :
Using this pointer
6. What will happen when an exception is not processed?
A. A member that can never be changed
B. A member that can be updated only if it not a member of constant object
C. A member that can be updated even if it a member of constant object
D. A member that is global throughout the class
Show Correct Answer
Correct Answer is :
A member that can be updated even if it a member of constant object
7. What are the essential operators in c++?
A. 5
B. Error
C. Segmentation fault
D. Undefined value
Show Correct Answer
Correct Answer is :
5
8. In which direction does the assignment operation will take place?
A. They reduce function call overheads
B. These functions are inserted/substituted at the point of call
C. Saves overhead of a return call from a function
D. They are generally very large and complicated function
Show Correct Answer
Correct Answer is :
They are generally very large and complicated function
9. Pick out the compound assignment statement.
A. function contains static variables
B. function have recursive calls
C. function have loops
D. all of the mentioned
Show Correct Answer
Correct Answer is :
all of the mentioned
10. What is the associativity of add(+);
A. 1055
B. 555
C. 101010
D. 51010
Show Correct Answer
Correct Answer is :
101010
11. What is the name of | operator?
A. 10
B. Error
C. Segmentation Fault
D. 5
Show Correct Answer
Correct Answer is :
Error
12. Which operator is having the highest precedence in c++?
A. All the functions containing declared inside the class
B. All functions defined inside or with the inline keyword
C. All the functions accessing static members of the class
D. All the functions that are defined outside the class
Show Correct Answer
Correct Answer is :
All functions defined inside or with the inline keyword
13. What is an exception in C++ program?
A. 1
B. 2
C. 3
D. 4
Show Correct Answer
Correct Answer is :
2
14. By default, what a program does when it detects an exception?
A. int main(int argc, char const *argv[]);
B. int main(int argc, char const **argv);
C. int main(int argc, char **argv);
D. all of the mentioned
Show Correct Answer
Correct Answer is :
all of the mentioned
15. Why do we need to handle exceptions?
A. Number of command line arguments
B. List of command line arguments
C. Dictionary of command line arguments
D. Stack of command line arguments
Show Correct Answer
Correct Answer is :
Number of command line arguments
16. How Exception handling is implemented in the C++ program?
A. Number of command line arguments
B. List of command line arguments
C. Dictionary of command line arguments
D. Stack of command line arguments
Show Correct Answer
Correct Answer is :
List of command line arguments
17. What is the correct syntax of the try-catch block?
A. First argument is of int type
B. Stores the count of command line arguments
C. First argument is non-negative
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
18. Which part of the try-catch block is always fully executed?
A. Second parameter is an array of character pointers
B. First string of the list is the name of the program’s output fle
C. The string in the list are separated by space in the terminal
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
19. Which of the following is an exception in C++?
A. argv[3]
B. argv[1]
C. argv[0]
D. argv[2]
Show Correct Answer
Correct Answer is :
argv[0]
20. What is the difference between error and exception?
A. #
B. $
C. space
D. |
Show Correct Answer
Correct Answer is :
space
Similar Interview Questions
Search for latest jobs
Find Jobs