Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

C Pointer Exercises: Understanding Value and Effect of Pointer Operations, Exercises of C programming

A series of C pointer exercises to help readers understand the value and effect of various pointer operations, including dereferencing, assigning values, and changing memory addresses. The exercises involve determining the values of pointers and the impact of different pointer manipulations on memory.

Typology: Exercises

2021/2022

Uploaded on 02/11/2022

ekansh
ekansh 🇺🇸

4.3

(20)

266 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Basic C pointer exercises
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download C Pointer Exercises: Understanding Value and Effect of Pointer Operations and more Exercises C programming in PDF only on Docsity!

Basic C pointer exercises

What is the value of *p?

p (of type _char_* ) 'h' 'e' 'l' 'l' 'o'

What is the value of p[4]?

p 'h' 'e' 'l' 'l' 'o'

What is the effect of *p = 'x'?

p 'h' 'e' 'l' 'l' 'o'

What is the effect of p = p+2?

p 'e' 'e' 'l' 'l' 'o'

What is the effect of p = &p[2]?

p 'e' 'e' 'l' 'l' 'o'