Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
GCC does not conform to any ANSI/ISO standards, if that isn't a problem for you, your employer, etc game on. C++ is an object oriented language derived from C. C is not an object oriented language. Being object oriented, C++ has many more tools in its libraries for declaration of objects including dynamically allocated arrays. My comment was not in response to a solution in C++. You can learn the way that works some of the time or the way that works all of the time.
Why such reaction tho? GCC supports VLAs since, like, forever, even in C++. For non-MSVC part of the world they are probably not that surprising?
"int tills[n]" declares a variable-length array (VLA) which was not implemented until the C99 standard and was relegated in C11. MSVC, for example, does not support VLA. Depending on what compiler you are using and the standards it conforms to (or avoids) attempting to decalare a VLA in C may throw an error. As I understand it, the reason this support was removed is due to the vulnerability it introduces to stack based buffer overflow exploits. Using malloc or calloc from stdlib will ensure you don't run into errors while compiling in other environments.
My comment was not meant to mock anyone, it was more of a reaction to the fact that the compiler here actually lets you get away with it.
If you mock beginners for bad practice, it'd be nice to explain what's wrong about it.
I see a lot of solutions using variables to declare arrays in C "int tills[n]; ". Good luck getting that to compile in the real world.