⟩ What is Asynchronous Exceptions?
The errors that are caused by events that are beyond control of the program are Asynchronous Exceptions. E.g. Keyboard interrupts
The errors that are caused by events that are beyond control of the program are Asynchronous Exceptions. E.g. Keyboard interrupts
In nested try block, if inner catch handler gets executed, then______________ a. Program execution stops immediately b. Outer catch handler will also get executed c. Compiler will jump to the outer catch handler and then executes remaining executable statements of main() d. Compiler will execute remaining executable statements of outer try block and then the main()
If inner catch handler is not able to handle the exception then__________. a. Compiler will look for outer try handler b. Program terminates abnormally c. Compiler will check for appropriate catch handler of outer try block d. None of these
What are the advantages of using friend classes?
Explain advantages of using friend classes?
What is a friend function?
Explain the characteristics of friend functions?
Explain friend function?
What are friend classes?
What is the output of this program?
#include <iostream>
using namespace std;
class Box
{
double width;
public
friend void printWidth( Box box );
void setWidth( double wid );
};
void BoxsetWidth( double wid )
{
width = wid;
}
void printWidth( Box box )
{
box.width = box.width * 2;
cout << "Width of box " << box.width << endl;
}
int main( )
{
Box box;
box.setWidth(10.0);
printWidth( box );
return 0;
}
a) 40
b) 5
c) 10
d) 20Which keyword is used to declare the friend function? a) firend b) friend c) classfriend d) myfriend