Lesson 20 of 23

Pointers आणि Arrays

10 min 35 XP

Array चे नाव म्हणजे त्याच्या पहिल्या घटकाचा address, म्हणून a[i] आणि *(a + i) एकच. p++ पुढच्या घटकावर जातो (int साठी 4 bytes पुढे).

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

Challenge

+35 XP

n आणि n संख्या वाचा. फक्त pointers वापरून (a[i] नाही; *(a + i) किंवा p++) array जागीच उलटा करा, मग print करा. Input: 5 1 2 3 4 5 Output: 5 4 3 2 1

Output Loading C (first time takes a few seconds)
Press Run to see the result here.