Tag: functions
All the articles with the tag "functions".
-
Inline Functions in C++: What the inline Keyword Really Does
Learn what inline means in C++, why it is about the One Definition Rule and not speed, when the compiler inlines code anyway, and when to use inline in headers.
-
How to Return Multiple Values from a C++ Function: 5 Practical Methods
Updated:C++ functions return one value by default. Learn five clean ways to return multiple values: structs, pairs, tuples, output parameters, and std::tie.
-
Variable Scope in C++: Local, Global, and Block Scope Explained
Understand variable scope in C++ with examples. Learn local vs global variables, block scope, shadowing, and why global variables cause hard-to-find bugs.
-
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.