Yes,
size_t n = sizeof(tbl) / sizeof(tbl[0])
is the most typical way to do this.
Please note that using int for array sizes is not the best idea.
Yes,
size_t n = sizeof(tbl) / sizeof(tbl[0])
is the most typical way to do this.
Please note that using int for array sizes is not the best idea.