Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 2
    $\begingroup$ Hard to remember back this far, but the malloc example is useful even if you skip over the work underneath. It exposes the machinery inside the black box just enough. $\endgroup$ Commented May 27, 2017 at 10:19
  • 2
    $\begingroup$ Is this an AP CS class, or something where you have more free reign in the curriculum? And what is the general language of the course? $\endgroup$ Commented May 27, 2017 at 10:34
  • 1
    $\begingroup$ Yes, AP CS Principles, more specifically CS50 AP. The curriculum includes pointers in an optional unit, but my gut says to include it regardless. We spend about a week in Scratch for general programming concepts and then focus on C for the rest of the semester before also going over basic Python the second semester. $\endgroup$ Commented May 27, 2017 at 18:30
  • $\begingroup$ Note: sizeof(myarray) gives the size of your array, (if I remember correctly) in bytes. Where as sizeof(mypointer) gives the size of a pointer (4 or 8, depending or architecture). Also arrays can-not be passed to another routine, only a pointer is passed. $\endgroup$ Commented May 28, 2017 at 9:19
  • $\begingroup$ I agree with @Sasha that 0-based arrays are a little strange but pointers are much much more difficult. Better to not confuse things by combining the two until both concepts are consolidated in students' minds. $\endgroup$ Commented Jun 9, 2017 at 18:52