Core Concepts Flashcards
What are the types of int?
+/-, +
short, ushort 16bit
int, uint 32bit
long, ulong 64bit
What are the types of float?
float 32bit,
double 64bit,
decimal 128bit
What is the stack vs heap?
Stack (fast memory) holds: Int, float.. Pointers to larger items
Heap (slower memory) holds: Strings, Classes, Variables, Arrays
How do the stack vs heap operate?
Stack is for static memory allocation, which allocates when compiled
Heap is for dynamic memory allocation, which allocates during run-time
What is LIFO vs FIFO?
Last In First Out, stack
First In First Out, queue
What is a class vs struct?
Class is a reference type: Copying points from stack to same object on heap
i.e i=0 i=j j=1, j & i now = 1
Struct is a value type: Copying creates another instance on stack