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.
.
.
Click on the title for the solution
.
.
.
Click on the title for the solution
.
.
This is the answer:
.
int **ip_arr = new int *[100];
for(int i = 0; i < 100; i++)
{
ip_arr[i] = new int(-1);
}
Comments
Post a Comment