O'Reilly logo

Ivor Horton's Beginning Visual C++® 2010 by Ivor Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Arrays, Strings, and Pointers

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to use arrays

  • How to declare and initialize arrays of different types

  • How to declare and use multidimensional arrays

  • How to use pointers

  • How to declare and initialize pointers of different types

  • The relationship between arrays and pointers

  • How to declare references and some initial ideas on their uses

  • How to allocate memory for variables dynamically in a native C++ program

  • How dynamic memory allocation works in a Common Language Runtime (CLR) program

  • Tracking handles and tracking references and why you need them in a CLR program

  • How to work with strings and arrays in C++/CLI programs

  • How to create and use interior pointers

So far, we have covered all the fundamental data types of consequence, and you have a basic knowledge of how to perform calculations and make decisions in a program. This chapter is about broadening the application of the basic programming techniques that you have learned so far, from using single items of data to working with whole collections of data items.

In this chapter, you'll be using objects more extensively. Although you have not yet explored the details of how they are created, don't worry if everything is not completely clear. You'll learn about classes and objects in detail starting in Chapter 7.

HANDLING MULTIPLE DATA VALUES OF THE SAME TYPE

You already know how to declare and initialize variables of various types that each holds a single item of information; I'll refer to single items ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required