#C
sizeof(char[n][n])
as in
#include <stdio.h>
int main(){
for( int n=0 ; n<10 ; n++ ){
printf("%d: %ld\n", n, sizeof(char[n][n]));
}
}
It works up to INT_MAX in constant time and no memory allocation.
#C
sizeof(char[n][n])
as in
#include <stdio.h>
int main(){
for( int n=0 ; n<10 ; n++ ){
printf("%d: %ld\n", n, sizeof(char[n][n]));
}
}
It works up to INT_MAX in constant time and no memory allocation.