Chapter 4. Using Functions

After completing this chapter, you will be able to:

  • Declare function prototypes.

  • Define function bodies.

  • Call functions.

  • Deal with local and global variable scope.

  • Define and use overloaded functions.

By now, you should be fairly comfortable with basic C++/CLI syntax. You’ve seen how to declare variables, write statements, use operators, and perform simple console output. However, as your programs begin to grow larger, you need to organize your code to cope with the growing complexity.

In this chapter, you’ll learn how to divide a C++/CLI application into functions. First, you’ll see how to declare function prototypes to introduce the functions to the compiler. Next, you’ll see how to define function bodies to carry out the ...

Get Microsoft Visual C++/CLI Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.