16. When using overloaded functions in appication code, the compiler will call w
ID: 3668367 • Letter: 1
Question
16. When using overloaded functions in appication code, the compiler will call which one
17. Constructors, which are automatically called when? 18. the overloaded function executed is the one that does what?
19. It is perfectly valid to create pointers that point to __________
20. We are required to remember that once a class is declared, a class becomes a _____________, so we can use the class name as the type for the pointer
21. in order to refer directly to a member of an object pointed by a pointer we use ?
22. what action does the following a default operator perform? int a, b, c; a = b + c;
23. Is the following example an overloaded operator? Why? struct { string product; float price; } a, b, c; a = b + c;
24. To overload an operator and use it with classes we declare operator functions, which are regular functions whose names are the operator keyword followed by what?
25. What keyword represents a pointer to the object whose member function is being executed. It is a pointer to the object itself
Explanation / Answer
16. When using overloaded functions in appication code, the compiler will call which one
Ans: for overloaded functions the compiler will call the one whose parameters match the arguments used in the function call
17. Constructors, which are automatically called when?
Ans: In the case of constructors, which are automatically called when an object is created
18. the overloaded function executed is the one that does what?
Ans:
19. It is perfectly valid to create pointers that point to classes
20. We are required to remember that once a class is declared, a class becomes a valid type, so we can use the class name as the type for the pointer
21. in order to refer directly to a member of an object pointed by a pointer we use ?
Ans: we can use the arrow operator (->) of indirection.
22. what action does the following a default operator perform? int a, b, c; a = b + c;
Ans: The default operator is “+” here. It is a binary operator and applied on 2 integer operands b and c. So it will perform addition operation. b and c will be added and the result will be stored in a.
23. Is the following example an overloaded operator? Why? struct { string product; float price; } a, b, c; a = b + c;
Ans: Yes. Here “+” is overloaded. It is normally used to add numbers of any kind. But here it is used to combine two structure variables b and c.
24. To overload an operator and use it with classes we declare operator functions, which are regular functions whose names are the operator keyword followed by what?
Ans: operator <the operator> ( Class variable or object)
Operator -> Keyword
<the operator> -> any binary or relational operator, +,-,*,= etc
Parameter -> object of the class
25. What keyword represents a pointer to the object whose member function is being executed. It is a pointer to the object itself
Ans: keyword is “this”
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.