So I had to write a program in Pascal (A bubble sort, it was pretty simple) and at the end my professor asked a question about our code. He had us write two separate print procedures. The first printArray took in an Array of Integers as it's parameter, where printArray2 took in a type called arrayType which is defined as such:
TYPE
arrayType = ARRAY[1..20] OF INTEGER;
I'm kind of rambling now, but his question was "What was the difference in how the values are accessed when using the different print procedures?"
Just wondering if someone could maybe give me a hint. My original thought was it had something to do with how the memory locations are accessed, but I don't really know how to word it correctly.
Well, hopefully one of you fine people can help me out.
I assume your teacher has introduced you to the concepts of pass by value and pass by reference. I believe you're teacher is trying to get you to think about those concepts as it applies to a primitive array declaration vs declaring your own arrayType. That should at least give you a hint on your homework assignment.
This depends a bit on Pascal dialect+compiler, but I assume its the difference between typed array and open array, the latter of which has a different range (0..number_of_elements-1) than the former (1..number_of_elements)