Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CST - 2 1 0 Topic 1 Lab Question 3 ( Week 3 ) The purpose of this lab is to practice the following: Pointer

CST-210 Topic 1 Lab Question 3
(Week 3)
The purpose of this lab is to practice the following:
Pointer arithmetic and array manipulation.
Finish the following program by adding a loop that uses only the pointer variable arrPtr to print the elements in the array arr.
srand(time(NULL));
int arr[10];
arr[i]=rand()%20;
3
//print the array using the array name
for (int i=0;i10;i++)
std::printf("%d wi arr[i]);
}
std: : cout std:;endt;
//print the array using only the pointer arrptr
//HINT: look up pointer arithmetic
int* arrPtr;
image text in transcribed

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

=+How has the organization changed its organizational strategy?

Answered: 1 week ago