Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Allocate an array of 100 integer pointers and assign the resulting pointer to the appropriately declared variable, ip_arr. Allocate 100 integers and assign the

C++

Allocate an array of 100 integer pointers and assign the resulting pointer to the appropriately declared variable, ip_arr. Allocate 100 integers and assign the resulting pointers to the elements of ip_arr. Initialize each integer value to -1.

this is what i have but it generates an error:

int *ip_arr = new int [100]; for(int i = 0; i < 100; i++) { *ip_arr[i] = new int(-1); }

here is the error:

CTest.cpp:5:11: error: invalid type argument of unary * (have int) *ip_arr[i] = new int(-1); ^

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

2. What is their level of comprehension?

Answered: 1 week ago