সোমবার, ২৯ অক্টোবর, ২০১২

Odesk Programming C++ Test Solution

Odesk Programming C++ Test Solution 
Odesk Programming C++ Test Solution
 00000000000-----Question

   000000000---Answers

Base class members are made accessible to a derived class and inaccessible to rest of the program by _____. 
protected access specifier
Which of the following is a function that returns a non zero value to indicate an I/O stream error?
a. bad

b. good

c. fail

d. eof

e. err

f. error

g. filerror

h. None of the above

h. None of the above
Consider the sample code given below and answer the question that follows.
class Shape
{
public:
virtual void draw() = 0;
};

class Rectangle: public Shape
{
public:
void draw()
{
// Code to draw rectangle
}
//Some more member functions.....
};
class Circle : public Shape
{
public:
void draw()
{
// Code to draw circle
}
//Some more member functions.....
};

int main()
{
Shape objShape;
objShape.draw();
}

What happens if the above program is compiled and executed?
 
e. None of the above
Which of the following techniques should you use to handle a constructor that fails?
a. Return an error code from the constructor

b. Throw an exception from the constructor

c. Write the error to a log file

d. Use "delete this;" in the constructor

e. None of the above
 
b. Throw an exception from the constructor

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন

Popular Posts

অনুসরণকারী

এই ব্লগটি সন্ধান করুন