Skip to content

Commit b2814d7

Browse files
Small change
1 parent 8afd7d1 commit b2814d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Good-First-Issues/Virtual Pointer and Virtual Functions in CPP.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This is achieved by using `virtual` keyword.
1010

1111
To give you demonstration:
1212

13-
```
13+
```cpp
1414
#include <iostream>
1515
using namespace std;
1616

@@ -46,7 +46,7 @@ When fuction g() is called, function A::f() is called, although the argument ref
4646
4747
The following example is the same as the previous example, except that A::f() is declared with the `virtual` keyword:
4848
49-
```
49+
```cpp
5050
#include <iostream>
5151
using namespace std;
5252
@@ -89,7 +89,7 @@ There are two things that occur when we create an object of a class which has vi
8989
- If object of that class is created then a **virtual pointer (VPTR**) is inserted as a data member of the class to point to VTABLE of that class. For each new object created, a new virtual pointer is inserted as a data member of that class.
9090
- Also, a class will contain a static array of functions pointers caleed **VTABLE**. Cells of this table stores the address of each virtual function contained in that very class
9191

92-
```
92+
```cpp
9393
#include <iostream>
9494
using namespace std;
9595

0 commit comments

Comments
 (0)