Question

The __________ operator is used to dynamically allocate memory.

Solution

Verified
Answered 1 year ago
Answered 1 year ago
Step 1
1 of 2

In the C ++ programing language, the new operator is used to dynamically allocate memory space, for example

ptrName = new ptrDataType;  //allocate single variable 
ptrName = new ptrDataType[NumberOfItems]; //allocate array of variables
//Concrete example:
char *charPtr = new char;
int *intPtr = new int[5]; 

Create an account to view solutions

Create an account to view solutions

More related questions

1/4

1/7