Difference between revisions of "Intermediate C++ Game Programming Tutorial 2"

From Chilipedia
Jump to: navigation, search
(Video Timestamp Index)
(Part 1)
Line 18: Line 18:
 
== Homework ==
 
== Homework ==
 
=== Part 1 ===
 
=== Part 1 ===
Write a function called <code>sum</code> which returns the sum of all elements of an int array.
+
Write a function called <code>sum</code> which returns the sum of all elements of an <code>int</code> array.
  
 
== See also ==
 
== See also ==
 
* [[Intermediate C++ Game Programming Tutorial 3|Next in series (Tutorial 3)]]
 
* [[Intermediate C++ Game Programming Tutorial 3|Next in series (Tutorial 3)]]
 
* [[Intermediate C++ Game Programming Series]]
 
* [[Intermediate C++ Game Programming Series]]

Revision as of 23:22, 12 May 2017

In this two-part tutorial we learn all about pointers and pointer-related bullshits. Part one focuses on the basics--the most common pointer operations and the basic underlying mechanisms. In part two, we take a look at some less commonly-used but still important pointer operations (pointer arithmetic), as well as some other concepts related to pointers. This tutorial introduces a lot of new concepts and features, but is light on practical examples. In the following tutorials we will get more hands-on practice with pointers, but also make sure to experiment with them on your own after finishing Tutorial 2.

Topics Covered

Part 1

  • Declaring pointers
  • The addressof operator &
  • The dereference (indirection) operator *
  • The arrow (member of pointer) operator ->
  • The indexing (subscript) operator []
  • The nullptr pointer literal

Part 2

Coming soon!

Video Timestamp Index

Tutorial 2.1

Homework

Part 1

Write a function called sum which returns the sum of all elements of an int array.

See also