Start here · Essential guide
ArrayList in C++: Using std::vector
C++ has no ArrayList class. std::vector does the same job: a list that grows as you add elements. Here is how to create, read, loop over and resize one.
Strings, Containers and Memory
Using std::vector as an ArrayList and how linked lists differ from arrays.
Start here · Essential guide
C++ has no ArrayList class. std::vector does the same job: a list that grows as you add elements. Here is how to create, read, loop over and resize one.
An array stores elements in one block and reaches them by index. A linked list chains separate nodes together. Compare access, insertion and memory use.
In C, * and & are pointer operators. & gets the address of a variable, and * reads or changes the value at that address. Examples show how each one works.
A linked list is a chain of nodes, each holding a value and a pointer to the next node. See a complete C example that builds, prints and frees one.
gets() reads input with no limit on how many characters it stores, so it can overflow a buffer. Learn why it is unsafe and how fgets() is safer.
Related topics