I've noticed a lot of times people will write uint16_t instead of int that way it will work the same way and consume the same amount of memory regardless which platform it runs on. (int on uno is 16, int on due is 32). But what is the difference in unit16_t and size_t?
Stack overflow says
According to the 1999 ISO C standard (C99), size_t is an unsigned integer type of at least 16 bit (see sections 7.17 and 7.18.3).
size_t is an unsigned data type defined by several C/C++ standards, e.g. the C99 ISO/IEC 9899 standard, that is defined in stddef.h.1 It can be further imported by inclusion of stdlib.h as this file internally sub includes stddef.h.
This type is used to represent the size of an object. Library functions that take or return sizes expect them to be of type or have the return type of size_t. Further, the most frequently used compiler-based operator sizeof should evaluate to a constant value that is compatible with size_t.
Just to back up what AWOL said, the C++ standard explains it as:
The type size_t is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object.
The maximum sizes of objects/arrays is briefly explained here: http://arduino.land/FAQ/content/6/7/en/what-is-the-maximum-number-of-elements-an-array-can-have.html