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-ஐ in-place reverse செய்து 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.