Pointer Arithmetic in C++ — a practical guide to C++ pointer arithmetic with clear examples you can reuse in real projects.
C++ Tutorial Series (48/111). Prefer one article? Read the complete C++ tutorial.
Short description
Prefer iterators/indices over raw pointer arithmetic in application code.
Pointer arithmetic
int a[3] = {10, 20, 30};
int* p = a;
std::cout << *(p + 1) << 'n'; // 20