Saved Bookmarks
| 1. |
Explain pointers in C++. |
|
Answer» A variable that holds the address of another variable of the same data type can be called a pointer. Pointers can be created for any data type or user-defined datatypes LIKE class, structure, etc. It allows variable passing by REFERENCES using the address. For example: int x = 25;int *ptr = &x;cout << ptr;Here, ptr will store the address of x. That means the address of x is the ptr value. Uses of pointers:
|
|