• Complain

Loudon - C++ pocket reference

Here you can read online Loudon - C++ pocket reference full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Beijing, Farnham, year: 2003, publisher: OReilly Media, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    C++ pocket reference
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2003
  • City:
    Beijing, Farnham
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

C++ pocket reference: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "C++ pocket reference" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

C++ is a complex language with many subtle facets. This is especially true when it comes to object-oriented and template programming. The C++ Pocket Reference is a memory aid for C++ programmers, enabling them to quickly look up usage and syntax for unfamiliar and infrequently used aspects of the language. The books small size makes it easy to carry about, ensuring that it will always be at-hand when needed. Programmers will also appreciate the books brevity; as much information as possible has been crammed into its small pages.In the C++ Pocket Reference, you will find:

  • Information on C++ types and type conversions
  • Syntax for C++ statements and preprocessor directives
  • Help declaring and defining classes, and managing inheritance
  • Information on declarations, storage classes, arrays, pointers, strings, and expressions
  • Refreshers on key concepts of C++ such as namespaces and scope
  • More!
C++ Pocket Reference is useful to Java and C programmers making the transition to C++, or who find themselves occasionally programming in C++. The three languages are often confusingly similar. This book enables programmers familiar with C or Java to quickly come up to speed on how a particular construct or concept is implemented in C++.Together with its companion STL Pocket Reference, the C++ Pocket Reference forms one of the most concise, easily-carried, quick-references to the C++ language available.

Loudon: author's other books


Who wrote C++ pocket reference? Find out the surname, the name of the author of the book and a list of all author's works by series.

C++ pocket reference — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "C++ pocket reference" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
About the Author

Kyle Loudon is a software engineer at Matrix Semiconductor in Santa Clara, California, where he works with file systems and applications for memory chips. Prior to Matrix, Kyle developed platform software for embedded devices, including various wireless phones and the Apple iPod. He also led the graphical user interface group at Jeppesen Dataplan (now a part of Boeing), developed flight planning software, and created system software at IBM in the early 1990s. For the past several years, Kyle has taught object-oriented programming using C++ at the University of California, Santa Cruz Extension, and has worked with C++ since the beginning of its widespread use in 1990. Kyle is the author of Mastering Algorithms with C, also published by O'Reilly and Associates.

Chapter 1. C++ Pocket Reference
Introduction

The C++ Pocket Reference is a quick reference to the C++ programming language as defined by the international standard INCITS/ISO/IEC 148821998 . It consists of a number of short sections, each further divided into specific topics. Many of the topics include pointed, canonical examples.

At the outset, it is important to recognize that C++ is a vast language, admittedly difficult to describe in a pocket reference. As a result, this reference is devoted almost exclusively to presenting the language itself. Other references are available from O'Reilly & Associates describing the C++ Standard Library, a vast subject on its own. The C++ Standard Library includes all of the facilities of the C Standard Library plus many new ones, such as the Standard Template Library (STL) and I/O streams.

This book has been written for developers with a variety of backgrounds and experience levels in C++. Those with experience using C++ will find this book to be a uniquely focused reference to its most commonly used features. If you are new to C++, you may wish to work with a tutorial first and return to this reference later to research specific topics.

Typographic Conventions

This book uses the following typographic conventions:

Italic

This style is used for filenames and for items emphasized in the text.

Constant width

This style is used for code, commands, keywords, and names for types, variables, functions, and classes.

Constant width italic

This style is used for items that you need to replace.

Acknowledgments

I would like to thank Jonathan Gennick, my editor at O'Reilly, for his support and direction with this book. Thanks also to Uwe Schnitker, Danny Kalev, and Ron Passerini for taking the time to read and comment on an early draft of this book.

Compatibility with C

With some minor exceptions, C++ was developed as an extension, or superset, of C. This means that well-written C programs generally will compile and run as C++ programs. (Most incompatibilities stem from the stricter type checking that C++ provides.) So, C++ programs tend to look syntactically similar to C and use much of C's original functionality.

This being said, don't let the similarities between C and C++ fool you into thinking that C++ is merely a trivial derivation of C. In fact, it is a rich language that extends C with some grand additions. These include support for object-oriented programming, generic programming using templates, namespaces, inline functions, operator and function overloading, better facilities for memory management, references, safer forms of casting, runtime type information, exception handling, and an extended standard library.

Program Structure

At the highest level, a C++ program is composed of one or more source files that contain C++ source code. Together, these files define exactly one starting point, and perhaps various points at which to end.

C++ source files frequently import, or include , additional source code from header files . The C++ preprocessor is responsible for including code from these files before each file is compiled. At the same time, the preprocessor can also perform various other operations through the use of preprocessor directives . A source file after preprocessing has been completed is called a translation unit .

Startup

The function main is the designated start of a C++ program, which you as the developer must define. In its standard form, this function accepts zero or two arguments supplied by the operating system when the program starts, although many C++ implementations allow additional parameters. Its return type is int. For example:

int main( )int main(int argc, char *argv[])

argc is the number of arguments specified on the command line; argv is an array of null-terminated (C-style) strings containing the arguments in the order they appear. The name of the executable is stored in argv[0], and may or may not be prefixed by its path. The value of argv[argc] is 0.

The following shows the main function for a simple C++ program that prompts the user for actions to perform on an account:

#include #include #include using namespace std;#include "Account.h"int main(int argc, char *argv[]){ Account account(0.0); char action; double amount; if (argc > 1) account.deposit(atof(argv[1])); while (true) { cout << "Balance is " << account.getBalance( ) << endl; cout << "Enter d, w, or q: "; cin >> action; switch (action) { case 'd': cout << "Enter deposit: "; cin >> amount; account.deposit(amount); break; case 'w': cout << "Enter withdrawal: "; cin >> amount; account.withdraw(amount); break; case 'q': exit(0); default: cout << "Bad command" << endl; } } return 0;}

The class for the account is defined in a later example. An initial deposit is made into the account using an amount specified on the command line when the program is started. The function atof (from the C++ Standard Library) is used to convert the command-line argument from a string to a double.

Termination

A C++ program terminates when you return from main. The value you return is passed back to the operating system and becomes the return value for the executable. If no return is present in main, an implicit return of 0 takes places after falling through the body of main. You can also terminate a program by calling the exit function (from the C++ Standard Library), which accepts the return value for the executable as an argument.

Header Files

Header files contain source code to be included in multiple files. They usually have a .h extension. Anything to be included in multiple places belongs in a header file. A header file should never contain the following:

  • Definitions for variables and static data members (see for the difference between declarations and definitions).

  • Definitions for functions, except those defined as template functions or inline functions.

  • Namespaces that are unnamed.

    Note

    Header files in the C++ Standard Library do not use the .h extension; they have no extension.

Often you create one header file for each major class that you define. For example, Account is defined in the header file Account.h, shown below. Of course, header files are used for other purposes, and not all class definitions need to be in header files (e.g., helper classes are defined simply within the source file in which they will be used).

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «C++ pocket reference»

Look at similar books to C++ pocket reference. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «C++ pocket reference»

Discussion, reviews of the book C++ pocket reference and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.