0% found this document useful (0 votes)
13 views2 pages

Unit4 QB US03CBCA23 CPP

Unit 4 Qb

Uploaded by

andrerussel968
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Unit4 QB US03CBCA23 CPP

Unit 4 Qb

Uploaded by

andrerussel968
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
SYBCA- Sem-ITT US03CBC. “A23 - CPP QUESTION B: ANK - UNIT -4 MCQ 1. The correct function name for overloadin, the addition (+) operator is ‘A. operalor+ B, toperator C. operator( +) D. operator: 2. Which statement about operator overload: jing is false? ‘A. New operators can never be created. C. The precedence of an operator cannot be changed by overloading. B. Certain overloaded operators can change the number of arguments they take. D. Overloading cannot change how an operator works on builtin types. 3. To overload the += operator A. Only the + operator needs to be B. Only the + and = operators need to overloaded. be overloaded. C. The += operator must be explicitly | D. The + and = operators need to be overloaded. overloaded implicitly. 4. Which one of the following operators can be overloaded? At B. New é D. Sizeof 5, Which one of the following operators cannot be overloaded? ‘A. the function call () B+ Cc. >> D. 6. Which of the following statements is NOT valid about operator overloading? ‘A. Only existing operators can be overloaded. B. Overloaded operator must have at least one operand of its class type. © The overloaded operators follow the syntax rules of the original operalor. D. none of the above. 7. A pointer is ‘A. A keyword used to create variables B. A variable that stores address of an instruction C. A variable that stores address of other variable D. Allof the above 8. Which of the following declarations are illegal? A. void *ptr B. char *strl = “xyz” C. char str2 = “abe” D. const “int pL ‘ANS. 1(A) 2.8) 310) 46) 5.0) 6.0) 7.0 8.0) SHORT QUESTIONS 1, What is Operator Overloading? 2, What is an operator function? Describe the syntax of an operator function, 3. How many arguments are required in the definition of an overloaded unary operator? 4, Can we overload destructor? Explain your answer. 5, List some of the rules for overloading operator. 6, List out five operators to he overloaded in C++. 7. List the operators that can’t be overloaded? 8, Explain the multiple meanings of the operators << & >> in C++. 9. How will you overload Unary & Binary operator using, member functions? 10. How will you overload Unary and Binary operator using Friend functions? 111. List out the operators that cannot be overloaded using Friend function. 12. What is this pointer? 13. Whats stream? 14, What are input and output stream? 15. What is the difference between opening, a file with constructor function and with open()? LONG QUESTION 1. Explain binary operator overloading with example. 2. Explain unary operator overloading with example. 3. Explain binary operator overloading, using, friend function. Give example. 4. Explain the restriction and limitations in overloading operator. 5. Describe the various classes available for file operations. 6. What is file mode? Describe the various file mode operations available. 7. Explain opening file using, open () 8. Explain read (), write(),seek(),close()

You might also like