1 / 8

LAB#3

LAB#3. Pointers. Ex1: What is the output of the following code ?. firstvalue is 10 secondvalue is 20. Ex2: What is the output of the following code ?. firstvalue is 10 secondvalue is 20. Ex3: Pointers and Arrays (Trace). 10, 20, 30, 40, 50,.

ide
Download Presentation

LAB#3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LAB#3 Pointers

  2. Ex1: What is the output of the following code ? firstvalue is 10 secondvalue is 20

  3. Ex2: What is the output of the following code ? firstvalue is 10 secondvalue is 20

  4. Ex3: Pointers and Arrays (Trace) 10, 20, 30, 40, 50,

  5. Ex6:Write a C++ program that defines array b with 10 integer elements. Then the program should use pointers to reset each element in the array to ZERO.

  6. Ex7: introduce int variables x and y and int* pointer variables p and q. Set x to 2, y to 8, p to the address of x, and q to the address of y. Then print the following information: • The address of x and the value of x. • The value of p and the value of *p. • The address of y and the value of y. • The value of q and the value of *q. • The address of p (not its contents!). • The address of q (not its contents!).

More Related