C++: C++ Programming, For Beginners, Learn Coding Fast! (With 100 Tests & Answers) Crash Course, Quick Start Guide, Tutorial Book with Hands-On Projects, In Easy Steps! An Ultimate Beginner's Guide! by Ray Yao

C++: C++ Programming, For Beginners, Learn Coding Fast! (With 100 Tests & Answers) Crash Course, Quick Start Guide, Tutorial Book with Hands-On Projects, In Easy Steps! An Ultimate Beginner's Guide! by Ray Yao

Author:Ray Yao [Yao, Ray]
Language: eng
Format: azw3
Publisher: programming language c c coding language the c language c program to in c language programming languages c c computer language c
Published: 2018-02-16T16:00:00+00:00


Pointer Initialize

dataType *PointerName = &variable;

“dataType *PointerName = &variable” declares and initializes a pointer, stores the memory address of the variable into *PointerName”. “&” means memory address.

Example 6.2

#include <string>

#include <iostream>

using namespace std;

int main( ) {

int digit = 20;

int *digitPointer = &digit; // initializes a pointer

cout << "Address of digit is: " << digitPointer << endl;

cout << "Value of digit is: " << *digitPointer << endl;

return 0;

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.