Explain the use of new operator with an example
Answers
Answered by
1
Answer:
An Example of allocating array elements using “new” operator is given below: int* myarray = NULL; myarray = new int[10]; Here, new operator allocates 10 continuous elements of type integer to the pointer variable myarray and returns the pointer to the first element of myarray.
Explanation:
follow me
Answered by
2
An Example of allocating array elements using “new” operator is given below: int* myarray = NULL; myarray = new int[10]; Here, new operator allocates 10 continuous elements of type integer to the pointer variable myarray and returns the pointer to the first element of myarray.
Please mark as the Brainliest Answer and give thanks.
Similar questions
English,
3 months ago
Political Science,
3 months ago
Math,
3 months ago
Math,
6 months ago
Social Sciences,
6 months ago
Economy,
10 months ago
Economy,
10 months ago