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.