Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

C++

View:  
Sorted by:  

How to Avoid Code Injection in C++

The first rule of avoiding code inject into C++ programs is never, ever, allow user input to be processed by a general-purpose language interpreter. A common error with SQL-injection is that the program [more…]

C++: The String Container

The most common form of a C++ array is the null-terminated character string used to display text, which clearly shows both the advantages and disadvantages of the array. Consider how easy the following [more…]

C++ Programming: The Hacker′s Motives

After you′ve finished a quick study of programming and sharpened your C++ skills, you land that really sweet job that you were looking for at the bank. You′re a big-time programmer at the bank, and you′ve [more…]

The C++ Template Library

The standard C++ library provides a complete set of math, time, input/output, and DOS operations, to name just a few. Many of the early programs that you learn as a beginner use the so-called character [more…]

C++: Comparing Operators with Functions

The intrinsic data types are built into the C++ language, such as int, float, and double and the various pointer types. C++ enables the programmer to define the operators for classes that the programmer [more…]

C++ Programming: Operations on an Entire List

Some C++ programs can deal with data as it arrives and dispense with it. Most programs, however, must store data for later processing. A structure that is used to store data is known generically as a [more…]

C++ Programming: Make Your Way through a List

The C++ programmer iterates through an array by providing the index of each element. However, this technique doesn't work for containers like list that don't allow for random access. One could imagine [more…]

3 Tips for Using Templates in C++

A function template enables you to write something that looks like a function but uses one or more type holders that C++ converts into a true type at compile time. You should remember a few things when [more…]

What Are Exception Mechanisms in C++?

Occasionally functions don′t work properly — even for seasoned C++ programmers. The traditional means of reporting failure is to return some indication to the caller. C++ includes a mechanism for capturing [more…]

C++ Programming: Throwing Exceptions

A C++ function that allocates resources locally may need to catch an exception, do some processing, and then rethrow it up the stack chain. Consider the following example: [more…]

Why Does C++ Have a New Error Mechanism?

C++ uses the exception mechanism for errors. What′s wrong with error returns like FORTRAN used to make? Factorials cannot be negative, so you could have said something like “Okay, if [more…]

How Stream I/O Works in C++

Many beginning C++ programs read from the cin input object and output through the cout output object. Perhaps you haven't really thought about it much, but this input/output technique is a subset of what [more…]

C++: The Exception Mechanism

The next time you are examining a C++ code example, take a closer look at the steps that the code goes through to handle an exception. When the throw occurs, C++ first copies the thrown object to some [more…]

Open Modes in C++

This table shows the different modes in C++ that are possible when opening a file. However, you need to answer three basic questions every time you open a file: [more…]

What State Is a C++ File In?

A constructed C++ fstream object (including ifstream and ofstream) becomes a proxy for the file that it is associated with. For example, the stream object maintains state information about the I/O process [more…]

Methods of the C++ Stream Classes

The istream and ostream classes in C++ provide a number of methods, as shown in this table (this is not a complete list). The prototypes for these functions reside in the [more…]

Stream Input/Output in C++

The C++ classes ifstream and ofstream are subclasses of istream and ostreamdesigned to perform stream input and output to disk files. You can use the same extractors and inserters on [more…]

Default Stream Objects in C++

C++ adds a chunk of code to the front of your program that executes before main() gets control. Among other things, this code creates the default input/output objects shown in this table. [more…]

How to Use the Switch Statement in C++

The switch statement in C++ is a control statement that is useful in a limited number of cases. The switch statement resembles a compound ifstatement by including a number of different possibilities rather [more…]

How to Array the Arguments for Arrays in C++

An array is a sequence of variables in C++ that shares the same name and that is referenced using an index. Arrays are useful little critters that allow you to store a large number of values of the same [more…]

How to Use an Array in C++

An array is a sequence of variables in C++ that shares the same name and that is referenced using an index. The following C++ program inputs a sequence of integer values from the keyboard until the user [more…]

How to Initialize an Array in C++

In C++, a local variable does not start life with a valid value, not even the value 0. Said another way, a local variable contains garbage until you actually store something in it. Locally declared arrays [more…]

How to Create an Array of Characters in C++

The elements of an array in C++ can be of any type. Arrays of floats, doubles, and longs are all possible; however, arrays of characters have particular significance. [more…]

How to Create a String of Characters in C++

The elements of an array in C++ can be of any type. Arrays of floats, doubles, and longs are all possible; however, arrays of characters have particular significance. [more…]

How to Manipulate Strings with Character in C++

An array is a sequence of variables in C++ that shares the same name and that is referenced using an index. The following Concatenate program inputs two strings from the keyboard and concatenates them [more…]

Listings:1-2526-5051-7576-100more...

Sign Up for RSS Feeds

Computers & Software
Win $500. Easy. Enter to win now.

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.