O'Reilly logo

C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Second Edition by Brian Overland

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

9. Some Advanced Programming Techniques

With the ability to process data, print and analyze strings, and access disk files, you already have the tools to write some serious C++ programs. But there are some other tricks to point out before we leave the basics and focus on C++0x and object orientation.

We start with the topic of command-line arguments, a feature that can be used to improve the programs in Chapter 8.

Command-Line Arguments

All the programs in Chapter 8 operate on files. The first thing each of these programs does (after declaring variables) is prompt the user for a filename.

cout << "Enter a file name and press ENTER: ";cin.getline(filename, 80);

This works, but it’s not always the ideal solution. People using the DOS command line—or ...

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