100DaysOfGameDev: Day 10
So many ways to write a function it's crazy. We have an inline function, we have constexpr
function, we have a function where you don't modify the arguments, we have functions that take by reference, some take by value, and we have a special case for taking array for argument, don't forget about the std::array_initializer<T>
and if you wanna have an unspecified number of arguments there's a badass option of int prinf(const char* ...)
meaning a pointer to character and more arguements. The last one comes with three horsemen of the apocalypse va_list
, va_start()
, and va_end()
, truly dreadful. That's it for today folks, tomorrow expect more content about functions. Gotta remember everything 'cause I value my feet. See you!