









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










^
Step 1, calculate adjacent matrix Step 2, go into infinite loop and receive players’ input … ^ Discussion about how to use certain features ofC ^ Ask TA, myself, tutoring center ^ Send questions to mailiing lists ^ Check Textbook ^ Look at sample code or hints ^ Discuss with classmates in library, E309, etc.Discuss over the phone.
Multidimensional Array andPointers (I) ^ Pointers can point tomultidimensionalarrays too ^ Row major^ ^
E.g. char A[3][3]
A[2][3] A[2][2] A[2][1] A[2][0]
A[1][3] A[1][2] A[1][1] A[1][0]
A[0][3] A[0][2] A[0][1] A[0][0]
p A[0][0]A[0][1]A[0][2]A[0][3]A[1][0]A[1][1]A[1][2]A[1][3]A[2][0]A[2][1]A[2][2]A[2][3]
*int a[10][10] = {0,1,0,1,0,1,0,1};int p;for (row = 0; row < 10; row++)
for (column = 0; column < 10; column++)a[row][column] = 0; for (p = &a[0][0]; p <= &a[9][9]; p++)
*p = 0;
Multidimensional Array andPointers (III)
Multidimensional Array andPointers (IV) ^ Remember if ^ int a[10]; ^ Then automatically pointer a points to a[0] ^ (a is equivalent to &a[0])^ ^ What about^ ^ int b[10][10];^ ^ Is there an automatic pointer b?^ ^ Yes, but b = &b[0], not &b[0][0]^ ^ b is of type (int **) !! Pointer of pointers