Chapter 11: Memory Allocation and Strings


Overview

If the process of learning C++ could be plotted on a line graph, most programmers would probably agree the summit of the learning curve was reached in the previous chapter. Regardless, this chapter builds upon the information from the previous chapters and considers dynamic memory allocation and strings by providing the answers to two important questions: Can the size of arrays be specified at run time and can objects generally be created and destroyed on demand as opposed to when a program terminates or a function ends? and Is there an easy way to represent large blocks of text, such as words and spaces, paragraphs, etc.? Specifically, this chapter explores the following important topics:

  • The new and delete keywords

  • Strings and char arrays

  • String manipulation

  • Class std::string

  • std::string methods




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net