Enter your Sign-on user name and password.

Forgot password?
  • Follow us on:
Loading video...

Start Learning Now

Our free lessons will get you started (Flash® 10 required).
Get immediate access to our entire library.

Sign up for Educator.com

Features Overview

  • Get on-demand access to our complete library
  • Search and jump to exactly what you need to learn
  • Track your progress
  • Download practice and lesson files
  • *Ask questions and get answers from our community & instructors

Arrays & Pointers

  • Arrays are used for multiple pieces of data saved in a “chunk” of memory that the compiler will allocate
  • The size of the array is declared using square brackets
  • Square brackets are also used to specify which element of the array to work with in an expression
  • Arrays may be multi-dimensional
  • Arrays may be initialized at compile-time, which saves run-time and programmer effort for reference arrays
  • Character strings are a special case for initialing character arrays
  • Pointers are used to store the location, or the address, where data is stored, not the data itself
  • Use reference and dereference operators when working with pointers
  • Use pointer arithmetic when the pointer points into an array
  • Arrays passed as function parameters are “call by reference”, never “call by value”, since copying a large array can be impractical
  • Operators “new” and “delete” are used to allocate and de-allocate memory for arrays at run-time
  • Here are links to more information about C++ arrays and pointers: http://www.cplusplus.com/doc/tutorial/arrays/ http://www.cplusplus.com/doc/tutorial/pointers/

Arrays & Pointers

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

Computer Science: Introduction to C++