Related questions with answers
Question
The __________ operator is used to dynamically allocate memory.
Solutions
VerifiedSolution A
Solution B
Answered 2 months ago
Step 1
1 of 2To allocate memory space dynamically we use the new operator with the following syntax,
/*
// allocate single variable
ptrName = new ptrDataType;
//allocate array of variables
ptrName = new ptrDataType[numberOfItems];
*/
// example
int *iPtr = new int[10];
char *cPtr = new char;
NOTE : when you try to use use new to allocate a space which is not available , an exception is thrown to indicate that error.
Answered 2 years ago
Step 1
1 of 2The way a C++ program requests dynamically allocated memory is through the operator.
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Recommended textbook solutions


Starting Out with C++: Early Objects
7th Edition•ISBN: 9780136077749 (2 more)Godfrey Muganda, Judy Walters, Tony Gaddis874 solutions


More related questions
- computer science
- computer science
- computer science
1/4
- computer science
- computer science
- computer science
1/7