Difference between revisions of "My Notes"

From CDOT Wiki
Jump to: navigation, search
(Created page with '<p>will put notes here</p>')
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<p>will put notes here</p>
+
<ol>
 +
<li>when passing a multi-D array as parameter in function, the very first size of array can be unspecified while all the others must be specified.</li>
 +
<li>if pointer ptr + 5, the location vary depending onb which CPU being used(16-bit, 32-bit, 64-bit).</li>
 +
<li>a multi-D array like int x[3][4][2] contains 24 elements which locations range from 0 to 23. suppose ptr = x is a pointer, then &x[i][j][k] = pre + i*4*2 +j*2+k because i will be 0, 1, 2; j will be 0, 1, 2, 3; and k will be 0,1.</li>
 +
<li>an array name without any indexing brackets is pointer to the beginning of an array, so y[i] = *(y+i).</li>
 +
<li>pointer arithmetic runs from left to right.</li>
 +
</ol>

Latest revision as of 22:26, 21 June 2010

  1. when passing a multi-D array as parameter in function, the very first size of array can be unspecified while all the others must be specified.
  2. if pointer ptr + 5, the location vary depending onb which CPU being used(16-bit, 32-bit, 64-bit).
  3. a multi-D array like int x[3][4][2] contains 24 elements which locations range from 0 to 23. suppose ptr = x is a pointer, then &x[i][j][k] = pre + i*4*2 +j*2+k because i will be 0, 1, 2; j will be 0, 1, 2, 3; and k will be 0,1.
  4. an array name without any indexing brackets is pointer to the beginning of an array, so y[i] = *(y+i).
  5. pointer arithmetic runs from left to right.