Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This lab will exercise your understanding of some of the concepts covered in Chapter 12: pointers Part I 1. Define int variables x and y

This lab will exercise your understanding of some of the concepts covered in Chapter 12: pointers Part I

1. Define int variables x and y and int* pointer variables p and q.

Assign x the value 2, y the value 8, set p to contain the address of x, and q to contain the address of y. Then output the following information, using appropriate messages: a. The address of x and the value of x. b. The value of p and the value of *p. c. The address of y and the value of y. d. The value of q and the value of *q. e. The address of p (not its contents!). f. The address of q (not its contents!).

Part II

2. For the following, use the pointer notation ONLY. Do NOT use the array index [] notation. Define the variables below and write code which prints the characters in a c string in a reverse order. char s[10] = "abcde"; char* cptr;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago