From 101cf370c14622305617d1e589cc93001264d436 Mon Sep 17 00:00:00 2001 From: "harrisonj2@berea.edu" Date: Thu, 13 Aug 2026 15:37:26 -0400 Subject: [PATCH] Fixes build introduction build errors --- pretext/AtomicData/Pointers.ptx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pretext/AtomicData/Pointers.ptx b/pretext/AtomicData/Pointers.ptx index 75cb472..4fe1ffd 100644 --- a/pretext/AtomicData/Pointers.ptx +++ b/pretext/AtomicData/Pointers.ptx @@ -1,6 +1,7 @@
Pointers -

A C++ pointer pointeris a variable that stores a memory address memory address and can be used to indirectly + +

A C++ pointer pointeris a variable that stores a memory address memory address and can be used to indirectly access data stored at that memory location.

We know that variables in a computer program are used to label data with a descriptive identifier so that the data can be accessed and used by that @@ -80,9 +81,11 @@ main()

References are slower, but they are sometimes useful. If in C++, we want to create a analogous reference to a memory location, we must use a special data type called a pointer.

- + + Pointer Syntax -

When declaring a pointer in C++ that will point to the memory address of some + +

When declaring a pointer in C++ that will point to the memory address of some data type, you will use the same rules of declaring variables and data types. The key difference is that there must be an asterisk (*) between the data type and the @@ -97,7 +100,8 @@ SOMETYPE* variablename;

However, the first declaration is preferable because it is clearer to the programmer that the variable is in fact a pointer because the asterisk is closer to the variable name.

- + + The address-of operator, <c>&</c>

Now that we know how to declare pointers, how do we give them the address of where the value is going to be stored? One way to do this is to have a pointer @@ -303,5 +307,4 @@ int main( ) { -

- + \ No newline at end of file