Tracestr( mname ).getbuffer() what does it means in c++
Answers
Answered by
0
mark me brainliest answer
class Shape
{
public:
...
//a shape can be
virtual void draw
};
“A virtual function must be defined
for the class in which it is first
declared …” [Stroustrup]. The
redefinition of a virtual function in
a derived class is called overriding
(complete rewrite) or augmentation
(rewrite but with a call to the base
class function)
class Rectangle : pub
{
public:
...
void draw() { };
};
class Square : public
{
public:
...
void draw() { };
};
...
Shape* theShape = new
// with the help of v
// a Square will be d
// a Rectangle or any
theShape->draw();
Through virtual functions C++
achieves what is called late binding
(dynamic binding or runtime
binding), that is actually
connecting a function call to a
function body at runtime based on
the type of the object and not at
compilation time (static binding)
(**)
class Shape
{
public:
...
//a shape can be
virtual void draw
};
“A virtual function must be defined
for the class in which it is first
declared …” [Stroustrup]. The
redefinition of a virtual function in
a derived class is called overriding
(complete rewrite) or augmentation
(rewrite but with a call to the base
class function)
class Rectangle : pub
{
public:
...
void draw() { };
};
class Square : public
{
public:
...
void draw() { };
};
...
Shape* theShape = new
// with the help of v
// a Square will be d
// a Rectangle or any
theShape->draw();
Through virtual functions C++
achieves what is called late binding
(dynamic binding or runtime
binding), that is actually
connecting a function call to a
function body at runtime based on
the type of the object and not at
compilation time (static binding)
(**)
Similar questions
Math,
8 months ago
Computer Science,
8 months ago
Biology,
1 year ago
Math,
1 year ago
Math,
1 year ago