Anasayfa
/
Teknoloji
/
exer cise -5 int q p = stuff; consider the code above. a) write a statement using pointer variable p, that would be equivalent to

Soru

EXER CISE -5 int q p = stuff; Consider the code above. a) Write a statement using pointer variable p, that would be equivalent to stuff[4] b) Write a statement that would assign the address of the third element of stuff to pointer q

Çözüm

4.4 (257 Oylar)
Osman
Uzman doğrulaması
Elit · 8 yıl öğretmeni

Cevap

a) To access the 5th element of the array using the pointer variable `p`, you can use the following statement:```p + 4```b) To assign the address of the third element of `stuff` to the pointer `q`, you can use the following statement:```q = &stuff[2];```