I am having trouble creating a function to print arrays that works with any type. I have attempted the following function and main program:


However, it does not work and I keep encountering new problems even after attempting to correct them. The error message is below:

Any suggestions on what I am doing wrong?
There's no reason why you should check a value of -1 as an indicator of array end. There is a specific function:
Size(). So your function could be:The XML version: