0% found this document useful (0 votes)
12 views1 page

C++ Pointer Declaration and Usage Guide

This document is a tutorial focused on pointers in C++. It includes tasks such as declaring pointers of various types, initializing them, and using them with arrays. The tutorial also covers concepts like array of pointers and dereferencing to manipulate and print values.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

C++ Pointer Declaration and Usage Guide

This document is a tutorial focused on pointers in C++. It includes tasks such as declaring pointers of various types, initializing them, and using them with arrays. The tutorial also covers concepts like array of pointers and dereferencing to manipulate and print values.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Tutorial 8

1. Write syntax for declaring a pointer.


2. Declare a pointer of type int.
3. Declare a pointer of type string.
4. Declare a pointer of type int that point to Variable num.
5. Declare a pointer of type string that point to Variable name.
6. Declare a pointer of type string that point to an array of four element.
7. Declare a pointer of type string that point to an array of four element and
initialize the element in the array using a pointer.
8. Print the element in Q7 using a pointer.
9. Declare a pointer of type string that point to an array and initialize the
element using cin and pointer.
[Link] a pointer of type int that point to an Array and use subscript on a
pointer to initialize the element and use the constant pointer to print the
element in the array.
[Link] syntax to declare array of pointers.
[Link] array of pointers of type int having 10 elements.
[Link] the pointer in Q12.
[Link] the pointer content in Q13.
15. Using the Concept Array of Pointers in C++ write the
following:
a. Declare Array of pointers that has four element of type int, array
name must be numbers.
b. Initialize numbers to a new string.
c. Using dereferencing on numbers, Initialize the content where
numbers is pointing to.
d. Print the content using numbers.
16.

You might also like