Lecture 1 - Slide 20 : 34
Arrays and Pointers: Examples
Some programs that illustrate arrays and pointers in C
C Program with an array.
C++ preview: Similar program with vectors - variation 1.
C++ preview: Similar program with vectors - variation 2.
C++ preview: Similar program with vectors - variation 3.
A similar C program with pointers and dynamic allocation of memory - one dimensional.
C Program with two a dimensional array.
A similar C program with pointers - two dimiensional.
Illustration of array limitations in C: Cannot assign.
A solution: Copy the array in a for loop.
A solution: Copy the array with memcpy - a low-level alternative.
Illustration of array limitations in C: Cannot pass as value parameter.
Less confusing version that uses pointers.
Output from both of the two programs above.
C Time functions from time.h