Stack, Heap, and Memory Models

Stack —> Part of computer memory that keeps track of everything that is executed in your code & value types

Heap —> Part of computer memory that keeps track of any objects & structures in your code (i.e. reference types)

Value Types v.s. Reference Types

In C#, data/variables can either be a (1) value type or (2) reference type

Full List of C# Data/VariableTypes Categorized as Value Type or Reference Type

Value Types

Reference Types

byte

sbyte

char

bool

int

short

long

uint

ulong

ushort

decimal

float

double

struct

class

interface

delegate

object

string

Pointers

Def: An address for the location in memory for the reference type it belongs to.

AKA “Reference”

A pointer (reference) & a reference type are NOT the same thing…

Pointer —> Used to retrieve a reference type (which is located in a

Reference type —>

robot