I am running the following code in C++:
class Tile {
//class definition
};
bool myFunction(Tile* Tiles) {
sizeof(Tiles);
sizeof(Tiles[0]);
/
Answering my own question:
Why I'm posting this answer
I was new to C++ at the time, and other questions have been marked as a duplicate of this. As such, I'm guessing that other questions like this are from C++ newbies. This answer will be for the benefit of those newbies.
My answer
Unlike in higher-level languages like Python or JAVA, the length of an array is not stored with the contents of the array, so there is no way to access it.
As such, it must be passed as a separate parameter. It may not make much sense in higher-level languages, but it's necessary in both C and C++.
Also, unlike in Python and JAVA, an array is not an object. To fully understand C/C++ arrays, one first must understand pointers.