Download C++: A Beginner`s Guide, Second Edition
Transcript
Indexing a Pointer As you have just seen, it is possible to access an array using pointer arithmetic. What you might find surprising is that the reverse is also true. In C++, it is possible to index a pointer as if it were an array. Here is an example. It is a third version of the case-changing program. The program creates a char pointer called p and then assigns to that pointer the address of the first element in str. Inside the for loop, p is indexed using the normal array indexing syntax. This is perfectly valid because in C++, the statement p[i] is functionally identical to *(p+i). This further illustrates the close relationship between pointers and arrays. 32 C++ A Beginner’s Guide by Herbert Schildt
Related documents
Syllabus - KVSeContents.in
Prototype Software for Automatic Generation of On
85MIV-L full V1.0
199007 rainbow
Table of Contents
User Manual Written by Bob Simmerman Special thanks to
CubeSuite+ V2.02.00 User`s Manual: RX Coding
C++ Library Reference - Oracle Documentation
Getting started with smallv - Riccardo Cassinis` home page
PLC Software MANUAL - Xinje-support-centre
Programmable High Precision DC Power Supply
User manual of LED Dance Floor