Tag: arrays
All the articles with the tag "arrays".
-
How to Find the Size of an Array in C++ (Length of an Array)
Updated:Find the length of an array in C++ the right way: the sizeof trick, std::size in C++17, and why an array's size is lost once you pass it to a function.
-
How to Pass an Array to a Function in C++ (The Right Way)
Updated:Learn how to pass an array to a function in C++: pointer decay, why you must pass the length, modifying in place, and how a std::vector makes it safer.
-
Tic Tac Toe in C++: Build a Complete Two-Player Game
Build a playable tic tac toe game in C++ from scratch. Learn how to draw the board, take player input, check for a winner, and handle draws with clean code.
-
std::array in C++: A Safer, Modern Alternative to C-Style Arrays
Learn std::array in C++, the size-aware, safer alternative to C-style arrays. How to declare it, loop over it, pass it to functions, and when to use it.