Introduction to Game Programming with C++ (Wordware Game Developers Library)
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
Категории