Table of Contents

reading_u06_Pointers_pointer.png

1. Memory addresses

When we declare a variable, what we're actually doing is telling the computer to set aside some memory (in RAM) to hold some information. Depending on what data type we declare, a different amount of memory will need to be reserved for that variable.

Data type Size
boolean 1 byte
character 1 byte
integer 4 bytes
float 4 bytes
double 8 bytes

A bit is the smallest unit, storing just 0 or 1. A byte is a set of 8 bits. With a byte, we can store numbers from 0 to 255, for an unsigned number (only 0 and positive numbers, no negatives).

Minimum value, 0

(Decimal value = \(128 \cdot 0 + 64 \cdot 0 + 32 \cdot 0 + 8 \cdot 0 + 4 \cdot 0 + 2 \cdot 0 + 1 \cdot 0\))

place 128 64 32 16 8 4 2 1
value 0 0 0 0 0 0 0 0

Maximum value, 255

(Decimal value = \(128 \cdot 1 + 64 \cdot 1 + 32 \cdot 1 + 8 \cdot 1 + 4 \cdot 1 + 2 \cdot 1 + 1 \cdot 1\))

place 128 64 32 16 8 4 2 1
value 1 1 1 1 1 1 1 1

A char only needs one byte to store a single letter because we represent letters with the ASCII or UTF8 codes 65 - 90 for upper-case, and 97 - 122 for lower-case.

Upper-case letter codes:

A B C D E F G H I J K L M
65 66 67 68 69 70 71 72 73 74 75 76 77
N O P Q R S T U V W X Y Z
78 79 80 81 82 83 84 85 86 87 88 89 90

Lower-case letter codes:

a b c d e f g h i j k l m
97 98 99 100 101 102 103 104 105 106 107 108 109
n o p q r s t u v w x y z
110 111 112 113 114 115 116 117 118 119 120 121 122

Any of these numbers can be stored with 8 bits:

A = 65…

(Decimal value = \(128 \cdot 0 + 64 \cdot 1 + 32 \cdot 0 + 8 \cdot 0 + 4 \cdot 0 + 2 \cdot 0 + 1 \cdot 1\))

place 128 64 32 16 8 4 2 1
value 0 1 0 0 0 0 0 1

z = 122…

(Decimal value = \(128 \cdot 0 + 64 \cdot 1 + 32 \cdot 1 + 8 \cdot 1 + 4 \cdot 0 + 2 \cdot 1 + 1 \cdot 0\))

place 128 64 32 16 8 4 2 1
value 0 1 1 1 1 0 1 0

So when we declare a variable, the computer finds an available space in memory and reserves the appropriate amount of bytes in memory. For example, our char could be assigned the memory address 0xabc008 in memory, and its value being stored would look like this:

…007 …008 …009 …00a …00b …00c …00d …00e …00f …010
… 0 1 1 1 1 0 1 0 …

(…007 and …010 are spaces in memory taken by something else)

We can view the addresses of variables in our program by using the address-of operator &. Note that we have used the ampersand symbol before to declare pass-by-reference parameters, but this is a different symbol used in a different context.

C++ source:

#include <iostream>
using namespace std;

int main()
{
  int number1 = 10;
  int number2 = 20;

  cout << &number1 << "\t" << &number2 << endl;

  return 0;
}

Running the program, it would display the memory addresses for these two variables. Notice that they're 4 bytes apart in memory (one is at …70 and one is at …74):

Program output:

0x7ffd3a24cc70	0x7ffd3a24cc74

Each time we run the program, we will get different memory addresses, since the operating system reclaims that memory when the program ends, and gives us new memory spaces to allocate next time we run the program.

Program output:

0x7ffe0e708a80	0x7ffe0e708a84

When we declare an array of integers of size \(n\), the program asks for \(n \times 4\) bytes of memory to work with. The two variables above didn't have to be side-by-side in memory; they just happened to be because they were declared close together. With an array, however, all elements of the array will be contiguous (side-by-side) in memory.

Here we have an array of integers:

C++ source:

int arr[3];

for ( int i = 0; i < 3; i++ )
{
  cout << &arr[i] << "\t";
}

And the output:

Program output:

0x7ffd09a130c0	0x7ffd09a130c4	0x7ffd09a130c8

Because the elements of an array must be contiguous in memory, we cannot resize a normal array. After our array is declared, chances are the memory addresses right after it will be put to use elseware on the computer and will be unavailable to our program and our array.

But, after we learn about pointers, we will learn how we can dynamically allocate as much memory as we need at any time during our program's execution - giving us the ability to "resize" arrays by allocating space for a new array, copying the data over to the larger chunk of memory, and deallocating the old chunk of memory from the smaller array.

2. Pointers

Pointers are a type of variable, but instead of storing data like "text" or numbers 123, it stores memory addresses. We can then access the data stored at the memory address indirectly, not through its original variable. We also use pointers to dynamically allocate memory.

2.1. Creating pointer variables

We can declare special variables that store memory addresses rather than storing an int or float or char value. These variables are called pointers.

We can declare a pointer like this: int* ptrNumber;

Or like this: int * ptrNumber;

Or like this: int *ptrNumber;

But note that doing this declares one pointer and several integers:

int * ptrNumber, notAPointer1, notAPointer2;

To avoid confusion, declare multiple pointers on separate lines.

If we declare a pointer as an int* type, then it will only be able to point to the addresses of integer variables, and likewise for any other data type.

  • Warning: Safety with pointers! Remember how variables in C++ store garbage in them initially? The same is true with pointers - it will store a garbage memory address. This can cause problems if we try to work with a pointer while it's storing garbage.

    To play it safe, any pointer that is not currently in use should be initialized to NULL or nullptr.

    Declaring a pointer and initializing it to nullptr:

C++ source:

#include <iostream>
using namespace std;

int main()
{
  int * ptr = nullptr;

  return 0;
}

2.2. Assigning pointers to addresses

Once we have a pointer, we can point it to the address of any variable with a matching data type. To do this, we have to use the address-of operator to access the variable's address - this is what gets stored as the pointer's value.

  • Assigning an address during declaration: int * ptr = &somevariable;
  • Assigning an address after declaration: ptr = &somevariable;

After assigning an address to a pointer, if we cout the pointer it will display the memory address of the pointed-to variable - just like if we had used cout to display the address-of that variable.

C++ source:

// Shows the same address
cout << ptr << endl;
cout << &somevariable;

Here's a simple program that has an integer var with a value of 10, and a pointer ptr that points to var's address.

C++ source:

#include <iostream>
using namespace std;

int main()
{
  int * ptr;
  int var = 10;

  ptr = &var;

  cout << "var address: " << &var << endl;
  cout << "ptr address: " << &ptr << endl;
  cout << "var value:   " << var << endl;
  cout << "ptr value:   " << ptr << endl;

  return 0;
}

The output would look like:

Program output:

var address: 0x7ffc3d6028b0
ptr address: 0x7ffc3d6028b4
var value:   10
ptr value:   0x7ffc3d6028b0

Some things to note:

  • var stores its data at its address 0x7ffc3d6028b0.
  • ptr stores its data at its address 0x7ffc3d6028b4.
  • var's value is 10, since it's an integer.
  • ptr's value is the address of var, since it's a pointer-to-an-integer.

Pointers_ptrmemory.png

2.3. Dereferencing pointers to get values

Once the pointer is pointing to the address of a variable, we can access that pointed-to variable's value by dereferencing our pointer. This gives us the ability to read the value stored at that memory address, or overwrite the value stored at that memory address.

We dereference the pointer by prefixing the pointer's name with a * - again, another symbol being reused but in a different context.

In this code, we point ptr to the address of var. Outputting ptr will give us var's address, and outputting *ptr (ptr dereferenced) will give us the value stored at var's address.

C++ source:

int * ptr;
int var = 10;

ptr = &var;

cout << "ptr value:        " << ptr << endl;
cout << "ptr dereferenced: " << *ptr << endl;

Program output:

ptr value:        0x7ffd21de775c
ptr dereferenced: 10

Then, we could also overwrite the value stored at var's address by again dereferencing the pointer and writing an assignment statement:

*ptr = 20;

When we output the value that var is storing, either directly through var or through the ptr, we can see that the value of var has been overwritten:

C++ source:

cout << "var value:        " << var << endl;
cout << "*ptr value:       " << *ptr << endl;

Output:

var value:        20
*ptr value:       20

3. Pointer cheat sheet

Declare a pointer int* ptrInt;
  float *ptrFloat;
Assign pointer to address ptrInt = &intVar;
  ptrFloat = &floatVar;
Dereference a pointer cout << *ptrChar;
  *ptrInt = 100;
Assign to nullptr float *ptrFloat = nullptr;
  ptrChar = nullptr;

4. Invalid memory access with pointers

Remember that when you declare a variable in C++, it will initially store garbage. This is true of pointers as well. When you declare a pointer without initializing it to nullptr, it will be storing random garbage that it will try to interpret as a memory address. If you dereference a pointer that is pointing to garbage, your program is going to run into a problem - a segmentation fault.

C++ source: A pointer pointing to garbage:

int main()
{
  int * bob;
  cout << *bob << endl;

  return 0;
}

Output:

Segmentation fault (core dumped)
How do we check whether memory address is valid?

In short, we can't check if an address stored in a pointer is valid. This is why we initialize our pointers to nullptr when they're not in use - we know nullptr means that the pointer is not pointing to anything.

5. Dynamically allocating memory

One handy use of pointers is to point at the addresses of other variables that were already declared. However, there is a second main use of pointers: To dynamically allocate memory any time we need new variables that we don't have to pre-write in the program.

5.1. Dynamic variables

At the moment, dynamic variables might seem pointless, but they are really handy for linked data structures - a type of structure you can use to store a series of data in that is an alternative to an array.

5.1.1. new and delete

We use the new keyword to allocate memory for the size of one variable data type (as opposed to an array of the variables), and delete to free up that memory.

Once we've allocated memory through the pointer, we can use the pointer as normal. The only difference is that we're now accessing an address that was allocated differently from the address of a "normal" variable.

  • Allocating memory for a single item: int * ptr = new int;
  • Deallocating memory for a single item: delete ptr;

Small program using a dynamic variable:

C++ source:

int main()
{
  int * myNumber;             // Declare pointer

  myNumber = new int;         // Allocate memory

  *myNumber = 10;             // Assign value

  cout << *myNumber << endl;  // Print value

  delete myNumber;            // Free memory

  return 0;
}

5.2. Dynamic arrays

For our normal arrays, we are unable to resize them during the program's run time because an array requires that all elements of the array are contiguous (side-by-side) in memory.

However, if we can allocate and deallocate memory any time we want with pointers, we can create a dynamic array. If we ever need to resize it, we allocate a new array of a bigger size and copy the data from the old array to the new one.

5.2.1. new[ ] and delete[ ]

When we're allocating space for an array of items, we use a slightly different set of keywords:

  • Allocate memory for an array: int * arr = new int[100];
  • Deallocate memory for an array: delete [] arr;

Example program that lets the user specify how big the array will be.

C++ source:

int main()
{
  int arraySize;
  float * pricesArray;

  cout << "How many items? ";
  cin >> arraySize;

  pricesArray = new float[arraySize]; // Allocate mem

  for ( int i = 0; i < arraySize; i++ )
  {
    cout << "Enter price for item " << i << ": ";
    cin >> pricesArray[i];
  }

  delete [] pricesArray;      // Deallocate memory

  return 0;
}

When you've used a pointer to allocate space for an array, you will access items in the dynamic array the same way you would do for a normal array. In other words, you would use the subscript operator [ ] to access elements at particular indices, and you don't need to prefix the pointer with the dereference operator *.

5.2.2. "Resizing" a dynamic array

Let's say we're writing a program that stores the user's library of movies they own. It saves a file so they can run the program any time, add or delete movies, close the program and open it again sometime later.

We can't realistically predict how many movies a person would own - some people might be collectors and have tons of movies. At the same time, if we were to over-estimate and make an array with, say, 10,000 elements, it would be a huge waste of memory if we had such a big array for someone who only had a few dozen movies.

A dynamic array would work perfectly here because we can initially create an array that's fairly small - maybe 10 items - and if the array fills up, we can then allocate more memory and copy the movies to the new array and deallocating the old array. If it fills up again, we just repeat the process, allocating more memory, copying the data over, and freeing the old array's memory.

Resizing steps: – The resizing process works like this:

  1. Create a pointer and use it to allocate a new, bigger array.
  2. Use a for loop to copy all the elements from the old-small-array to the new-big-array.
  3. Free the memory for the old-small-array.
  4. Update the array's pointer, which was pointing to old-small-array, to now point to the address of the new-big-array.

Normally, you would store a dynamic array inside of a class that acts as the interface for adding and removing data, where it will check if there's enough space before adding new information and resizing the array if not.

Here's an example of resizing a movie array within a MovieLibrary class:

C++ source:

void MovieLibrary::Resize()
{
  // Allocate more memory
  int newSize = m_arraySize + 10;
  string * newArray = new string[newSize];

  // Copy data from old array to new array
  for ( int i = 0; i < m_arraySize; i++ )
  {
    newArray[i] = m_movieArray[i];
  }

  // Free memory of old array
  delete [] m_movieArray;

  // Update the pointer to point at new array
  m_movieArray = newArray;

  // Update the array size
  m_arraySize = newSize;
}

Dynamic array example: Movie Library

Here's a small example of a class that contains a dynamic array, that allows users to add additional information, and handles checking for a full array and resizing.

C++ source: MovieLibrary.h

#ifndef _MOVIE_LIBRARY_HPP
#define _MOVIE_LIBRARY_HPP

#include <string>
using namespace std;

class MovieLibrary
{
public:
  MovieLibrary();
  ~MovieLibrary();

  void ViewAllMovies() const;
  void ClearAllMovies();
  void AddMovie( string newTitle );

private:
  bool IsFull();
  void Resize();

  string * m_movieArray;
  int m_arraySize;
  int m_itemsStored;
};

#endif

The methods IsFull() and Resize() are set as private because outside users don't need to know anything about how the data is stored. The outside users shouldn't be able to recall Resize whenever they want.

C++ source: MovieLibrary.cpp - Constructor

MovieLibrary::MovieLibrary()
{
  m_arraySize = 10;
  m_movieArray = new string[m_arraySize];
  m_itemsStored = 0;
}

In the constructor, we initialize our m_movieArray member pointer variable by allocating some memory to start with.

If we weren't going to allocate memory in the constructor, then we should initialize m_movieArray by setting it to nullptr.

We also have two separate size variables - m_arraySize keeps track of how many spaces are available in the array, and m_itemsStored keeps track of how many items the user has added to the array.

C++ source: MovieLibrary.cpp - Destructor

MovieLibrary::~MovieLibrary()
{
  if ( m_movieArray != nullptr )
    {
      delete [] m_movieArray;
    }
}

Before the MovieLibrary item is destroyed (e.g., when the program ends and it goes out of scope), we need to make sure to *free the memory that we allocated}. First, we need to check if the pointer m_movieArray is pointing to nullptr - if it is, we can assume it's not in use and there's nothing to do. But, if m_movieArray is pointing to some address, we assume that memory has been allocated here. In this case, we free that memory.

C++ source: MovieLibrary.cpp - ViewAllMovies

void MovieLibrary::ViewAllMovies() const
{
  for ( int i = 0; i < m_itemsStored; i++ )
    {
      cout << i << ". " << m_movieArray[i] << endl;
    }
}

This is just a simple for loop that goes from index 0 to m_itemsStored - 1, displaying each element to the screen.

We aren't iterating until i < m_arraySize because if our array size is 10 and the user has only stored 5 movies, we don't need to display 5 empty slots.

C++ source: MovieLibrary.cpp - ClearAllMovies

void MovieLibrary::ClearAllMovies()
{
  delete [] m_movieArray;
  m_movieArray = nullptr;
  m_arraySize = 0;
  m_itemsStored = 0;
}

If the user decides to clear out their movie array, we could just deallocate all memory reserved for the movie list and reset our size variables. We just need to make sure we're checking to make sure the array is allocated before we try to access elements from it or add to it.

C++ source: MovieLibrary.cpp - IsFull

bool MovieLibrary::IsFull()
{
  return m_itemsStored == m_arraySize;
}

The array is full if the amount of items the user has stored, m_itemsStored is equal to the amount of spaces we have allocated for the array, m_arraySize.

C++ source: MovieLibrary.cpp - AddMovie

void MovieLibrary::AddMovie( string newTitle )
{
  if ( m_movieArray == nullptr )
  {
    m_arraySize = 10;
    m_movieArray = new string[m_arraySize];
  }
  if ( IsFull() )
  {
    Resize();
  }

  m_movieArray[ m_itemsStored ] = newTitle;
  m_itemsStored++;
}

Before we add a movie, we need to make sure m_movieArray is set up and ready.

First, we check to see if it is pointing to nullptr. If it is, we allocate memory.

Next, we check to see if the array is full. If it is, we call Resize().

Finally, once those two checks have been done and the array has been prepared, we can add a new item to the array and increase hte m_itemsStored count.

C++ source: MovieLibrary.cpp - Resize

void MovieLibrary::Resize()
{
  int newSize = m_arraySize + 10;
  string * newArray = new string[newSize];

  for ( int i = 0; i < m_arraySize; i++ )
  {
    newArray[i] = m_movieArray[i];
  }

  delete [] m_movieArray;

  m_movieArray = newArray;
  m_arraySize = newSize;
}

This is the same Resize() method as was shown before as an example of resizing a dynamic array.

6. Memory Management

6.1. Types of memory errors

Working with pointers and dealing with memory can lead to writing code that can mess up our program or even slow down our computer (until the next reboot).

Invalid memory access:

Invalid memory access happens when a pointer isn't set to nullptr when it's no longer in use. If this doesn't happen, the memory address it's pointing to could be invalid, such as if delete was used on the pointer, or if the pointer were declared and not initialized.

An invalid memory access would cause a problem once you try to dereference the pointer pointing to an invalid address - causing a segfault and your program to crash.

Memory leak:

A memory leak occurs when you've allocated memory (via the new command) but you never deallocate it. C++ won't automatically deallocate this memory for you, and what happens is that chunk of memory ends up being "called for" even after the program has finished running. This memory block will be unavailable to all programs until the user restarts their computer.

If you had many items allocating memory but never freeing them, the resulting memory leaks could cause your computer to slow down over time (until the next reboot).

Missing allocation:

Missing allocation occurs if you try to delete memory that has already previously been freed. If this happens, the progrma will crash.

6.2. The Stack and the Heap

What is the difference between a normal variable…

int myNum;

… and a dynamically allocated variable?…

int * myNum = new int;

Well, there are different types of memory, and each is stored in a different space.

The Stack:

All of our non-dynamic variables we have been declaring, including function parameters and class member variables, get allocated to the Stack. The Stack part of memory has a fixed size, and it contains a sequence of memory addresses. The Stack automatically handles the memory management for these variables - when we declare a int count; variable, it will be pushed onto the Stack, and when it's not in use anymore (when it goes out of scope), it will be removed from (popped off) the Stack.

A "stack overflow" error occurs when so many variables have been declared that the Stack runs out of room. This usually occurs while writing recursive functions that have a logic error, causing them to repeat until we run out of Stack space.

The Heap:

The heap is where dynamically allocated data gets stored. The Heap does not automatically take care of memory management for us, so that is why we have to deal with new and delete ourselves (unless we're using a smart pointer). Any data in the Heap must be accessed via a pointer. There is no size restriction for the Heap.

7. Smart Pointers

In modern versions of C++ we have access to smart pointers, which allow us to utilize pointer functionality but without having to worry about the memory management side of things. It's important to see both the original style of pointers and the smart pointers so that you're acquainted with both in case you experience them in other classes or on the job.

7.1. shared_ptr

reading_u06_Pointers_SharedPointers.png

Figure 1: A drawing of three different pointers, A*, B*, and C*, all pointing at the same memory address.

Documentation: https://cplusplus.com/reference/memory/shared_ptr/

Shared pointers are meant for spaces in memory that will be pointed to by multiple pointers. The memory allocated at that address stays active up until the last pointer is destroyed - that triggers the deallocation of the memory once nobody is pointing to it anymore.

To illustrate this, let's create a City struct:

C++ source: City.h file

struct City
{
  City( string value )
  {
    name = value;
  }

  string name;
  shared_ptr<City> west_neighbor;
  shared_ptr<City> east_neighbor;
  shared_ptr<City> south_neighbor;
  shared_ptr<City> north_neighbor;
};

Each City can have a north, south, east, and/or west neighbor City. Instead of using a City* traditional pointer, we're using the shared_ptr object that's part of the <memory> C++ library.

Within our main program, we can create some cities. Instead of our dynamic variable allocation like City lenexa = new City( "Lenexa" );, it will look like this:

C++ source: main.cpp

shared_ptr<City> overland_park
  = shared_ptr<City>( new City( "Overland Park" ) );

shared_ptr<City> lenexa
  = shared_ptr<City>( new City( "Lenexa" ) );

shared_ptr<City> olathe
  = shared_ptr<City>( new City( "Olathe" ) );

shared_ptr<City> shawnee
  = shared_ptr<City>( new City( "Shawnee" ) );

For each of these shared pointers, this is the first reference to its memory address. When we set up neighbors for each city, we create additional references:

C++ source: main.cpp

// Set up neighbors
lenexa->east_neighbor         = overland_park;
overland_park->west_neighbor  = lenexa;
lenexa->south_neighbor        = olathe;
olathe->north_neighbor        = lenexa;
lenexa->north_neighbor        = shawnee;
shawnee->north_neighbor       = lenexa;

If these were traditional pointers, the syntax would look the same.

The shared_ptr class gives us access to a function called use_count(), which we can use to see how many shared pointers are currently pointing to a given memory address. (https://cplusplus.com/reference/memory/shared_ptr/) Using this, we can build out a table that displays each city, its address, and how many references are going to that address:

C++ source: main.cpp

cout << setw( 20 ) << "CITY"
     << setw( 20 ) << "ADDRESS"
     << setw( 20 ) << "USE COUNT"
     << endl << string( 80, '-' ) << endl;

cout << setw( 20 ) << overland_park->name
     << setw( 20 ) << overland_park
     << setw( 20 ) << overland_park.use_count()
     << endl;

cout << setw( 20 ) << lenexa->name
     << setw( 20 ) << lenexa
     << setw( 20 ) << lenexa.use_count()
     << endl;

cout << setw( 20 ) << olathe->name
     << setw( 20 ) << olathe
     << setw( 20 ) << olathe.use_count()
     << endl;

cout << setw( 20 ) << shawnee->name
     << setw( 20 ) << shawnee
     << setw( 20 ) << shawnee.use_count()
     << endl;

Program output:

CITY                ADDRESS             USE COUNT
-----------------------------------------------------
Overland Park       0x55f775311eb0      2
Lenexa              0x55f775311f40      4
Olathe              0x55f775311fd0      2
Shawnee             0x55f775312060      2

At the end of the program we don't have to include code like delete lenexa; to free the allocated memory. Since the shared_ptr is a class, the actual pointer is stored within that class, and utilizing the destructor, it will take care of cleaning up the memory for us.

7.2. unique_ptr

Documentation: https://cplusplus.com/reference/memory/unique_ptr/

With a unique_ptr, we create a pointer that is the only "owner" of the memory block it points to. We can move around "ownership" of that address, but only one pointer may point to it. When the owning unique_ptr goes out of scope and is destroyed, it will automatically free the space allocated at the memory address it owns.

This can be useful for creating a dynamic array but without having to deal with the memory management. Instead of allocating memory in the traditional way like: string* arr = new string[ array_size ];, we can use the unique_ptr:

C++ source:

unique_ptr<string[]> arr = unique_ptr<string[]>( new string[ array_size ] );

or you could use the auto keyword to make this a little nicer looking:

C++ source:

auto arr = unique_ptr<string[]>( new string[ array_size ] );
\begin{lstlisting}[style=cpp] \end{lstlisting}

Otherwise, we use this dynamic array similar to with traditional pointers, but we don't need the delete [] arr; at the end of the program.

C++ source:

for ( size_t i = 0; i < array_size; i++ )
{
  cout << "Enter value for #" << i << ": ";
  getline( cin, arr[i] );
}

If you need to change who owns the pointed-to address, the move command can be used:

C++ source:

// Previously declared:
// auto arr = unique_ptr<string[]>( new string[3] );
// auto biggerArray = unique_ptr<string[]>( new string[ newSize ] );
arr = move( biggerArray );

8. All the pointers: What to use?

I wanted to cover a lot of different forms of pointers you can use in C++ because it's likely you'll see them in different places - perhaps the basic pointers and dynamic memory allocation more in other CompSci classes, perhaps smart pointers more in a business context.

Generally, for actually implementing a product, you'll probably just be utilizing the std::vector so you don't have to worry about pointers at all - or chances are you'll be using C# or Java and use whatever List objects they provide.

Still, if you're taking a data structures course or additional CompSci courses in the future you might have to work with pointers directly, as it is part of how we understand how computers and memory works.

Author: RachelWil

Created: 2026-10-14 Wed 11:12

Validate