Lecture overview -- Keyboard shortcut: 'u'  Previous page: Arrays and Pointers -- Keyboard shortcut: 'p'  Next page: Structures and Unions -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    From C to C++ - slide 15 : 29

Arrays and Pointers: Examples
Some programs that illustrate arrays and pointers in C
array-1.c
C Program with an array.
array-1-ptr.c
A similar C program with pointers - one dimensional.
array-2.c
C Program with two a dimensional array.
array-2-ptr.c
A similar C program with pointers - two dimiensional.
array-limitations-1.c
Illustration of array limitations in C: Cannot assign.
array-limitations-1-with-for.c
A solution: Copy the array in a for loop.
array-limitations-2.c
Illustration of array limitations in C: Cannot pass as value parameter.
array-limitations-3.c
Less confusing version that uses pointers.
program-output-limitations-2-and-3
Output from both of the two programs above.
Go to exercise
C Time functions from time.h