Question: 1 . The C + + statement below declares an array and a pointer: int arr _ 1 [ 1 0 ] , * arr

1.The C++ statement below declares an array and a pointer:
int arr_1[10],*arr_2;
Determine if each expression below is valid or not, and briefly explain why.
a. arr_1= arr_1+5;
b. arr_2= arr_2+10;
c. arr_2= &arr_1;
d. arr_2= arr_2- arr_1;
e. arr_1[2]= arr_1- arr_2;
Hint: "validity" means that the expression can be interpreted and executed by the C++ compiler
not necessarily that it makes sense to the programmer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!