PLEASE TRACE BY HAND OR EXPLAIN WHAT EACH VALUE IS ASSIGNED TO /* SELECT the CODE SEGMENT that will use the pointer variable p to set all elements of the array to zero. (Note: ONLY POINTER NOTATION...



PLEASE TRACE BY HAND OR EXPLAIN WHAT EACH VALUE IS ASSIGNED TO






/*

SELECT the CODE SEGMENT that will use the pointer variable
p
to set all elements of the array to zero. (Note:  ONLY POINTER NOTATION CAN BE USED TO ANSWER THIS QUESTION.) */




#include



using
namespace

std;



int

main()



{





int

array[25];





int

*p, i;





// (a)



for

(i = 0; i < 25;="">



       {



             array[i] = 0;



       }






        // (b)



p = &array[0];





for

(i = 0; i < 25;="">



             {



                    *p = 0;



             }








       // (c)






p = array;





for

(i = 0; i < 25;="">



       {



             array[i] = 0;



       }






// (d)



i = 0;





for

(p = &array[0]; p < &array[0]="" +="" 25;="">



       {



             *p = 0;



       }





cout



endl


"That's all there is!"
;



system(
"Pause"
);





return

0;



}

//end main




Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here