Use templates where you have a function or class that can be genralised for types
i.e.

template<class T>

T max(T a, T b)

{

if (a > b)

return a;


return b;

}

This is a generalised template function for max. That defines the logic without defining the types. It will for for any type for which > is defined (i.e. basic types and classes overloading the > operator).
size_t is just an unsigned integer type that represents the size of something. It is returned by standard library functions like strlen and used as an input parameter in standadrd library functions like memcpy.