Well, in c++ arrays like this should have compile time fixed size. Which now they are I guess, so might as well just use constexpr instead of const for the rows_A, cols_A, rows_B, cols_B variables.
But there is something called VLA, short for Variable Length Array, in which case these arrays needn't be fixed size at compilation time, and they are allocated on that stack, but that's not part of the c++ standard.
Modern gcc/g++ compilers recognize these values for being fixed, but maybe you are trying to do something dynamic in your code? In that case you should use dynamic memory allocation with new/malloc, or use something like std::vector
Balint Varga
balazon
AI & ML interests
None yet
Recent Activity
commentedon an article 2 days ago
Introduction to ggmlOrganizations
None yet