Array designators used in expressions are implicitly converted (with rare exceptions as for example using them in the sizeof operator) to pointers to their first elements.
So in this call
print_elemTab(tab);
the argument expression has the type int *.
On the other hand, a function parameter having an array type is adjusted by the compiler to pointer to the element type of the array.
So for example these function declarations
void print_elemTab(int tab[]);
void print_elemTab(int tab[5]);
void print_elemTab(int tab[100]);
declare the same one function and are equivalent to the following declaration
void print_elemTab(int *tab);
You nay even include all these declarations in your program though the compiler can issue a message that there are redundant declarations.
Hence within the function you are dealing with a pointer of the type int *. And sizeof( int * ) is usually equal to 4 or 8 depending on the used system.
If you have such a declaration you should change it specifying a second parameter that will keep the number of elements in the passed array like
void print_elemTab(int *tab, size_t n );
And the function can be called like
print_elemTab(tab, std::size( tab ) );
Another approach is to pass the array by reference. In this case you should declare a template function for example like
template <size_t N>
void print_elemTab( int ( &tab )[N] );
Within the function you can either directly use the template parameter N as the number of elements in the array. Or you can apply the same standard C++ function std::size to the array.
Or the function can be even more general declared with a second template type parameter like
template <typename T, size_t N>
void print_elemTab( T ( &tab )[N] );
Another approach is to declare the function like
template <typename Container>
void print_elemTab( Container &container );
In this case you also may apply the standard function std::size to the parameter container.