Download A Tour of C++ (C++ In-Depth Series) by Bjarne Stroustrup PDF

By Bjarne Stroustrup

The C++11 average permits programmers to specific rules extra basically, easily, and without delay, and to jot down swifter, extra effective code. Bjarne Stroustrup, the dressmaker and unique implementer of C++, completely covers the main points of this language and its use in his definitive reference, The C++ Programming Language, Fourth version.
In A travel of C++ , Stroustrup excerpts the evaluation chapters from that whole reference, increasing and embellishing them to provide an skilled programmer–in quite a few hours–a transparent inspiration of what constitutes glossy C++. during this concise, self-contained consultant, Stroustrup covers such a lot significant language positive aspects and the foremost standard-library components–not, after all, in nice intensity, yet to a degree that provides programmers a significant assessment of the language, a few key examples, and useful assist in getting all started.

Stroustrup provides the C++ good points within the context of the programming types they help, comparable to object-oriented and accepted programming. His travel is remarkably finished. assurance starts with the fundamentals, then levels greatly via extra complex subject matters, together with many who are new in C++11, comparable to stream semantics, uniform initialization, lambda expressions, more advantageous packing containers, random numbers, and concurrency. The journey ends with a dialogue of the layout and evolution of C++ and the extensions extra for C++11.

This consultant doesn't target to coach you the way to software (see Stroustrup’s Programming: rules and perform utilizing C++ for that); nor will it's the one source you’ll want for C++ mastery (see Stroustrup’s The C++ Programming Language, Fourth variation, for that). If, even if, you're a C or C++ programmer short of larger familiarity with the present C++ language, or a programmer versed in one other language wishing to realize a correct photograph of the character and merits of contemporary C++, you can’t discover a shorter or easier creation than this journey presents.

Show description

Read or Download A Tour of C++ (C++ In-Depth Series) PDF

Similar programming books

OpenGL ES 2.0 Programming Guide

OpenGL ES 2. zero is the industry’s best software program interface and photos library for rendering subtle 3D pics on hand-held and embedded units. With OpenGL ES 2. zero, the whole programmability of shaders is now on hand on small and conveyable devices—including cellphones, PDAs, consoles, home equipment, and cars.

Flow-Based Programming: A New Approach To Application Development (2nd Edition)

Written by way of a pioneer within the box, this can be a thorough advisor to the fee- and time-saving benefits of Flow-Based Programming. It explains the theoretical underpinnings and alertness of this programming procedure in functional phrases. Readers are proven tips on how to observe this programming in a couple of components and the way to prevent universal pitfalls.

Objective-C Quick Syntax Reference

The Objective-C speedy Syntax Reference is a condensed code and syntax connection with the preferred Objective-C programming language, that is the center language at the back of the APIs present in the Apple iOS and Mac OS SDKs. It offers the basic Objective-C syntax in a well-organized structure that may be used as a convenient reference.

Object-Oriented Programming in C++ (4th Edition)

Object-Oriented Programming in C++ starts with the elemental ideas of the C++ programming language and systematically introduces more and more complex themes whereas illustrating the OOP method. whereas the constitution of this ebook is the same to that of the former version, every one bankruptcy displays the most recent ANSI C++ regular and the examples were completely revised to mirror present practices and criteria.

Additional resources for A Tour of C++ (C++ In-Depth Series)

Sample text

Being separate types, enum classes help prevent accidental misuses of constants. In particular, we cannot mix Traffic_light and Color values: Color x = red; Color y = Traffic_light::red; Color z = Color::red; // error : which red? 5) defined. However, an enumeration is a user-defined type so we can define operators for it: Traffic_light& operator++(Traffic_light& t) // prefix increment: ++ { switch (t) { case Traffic_light::green: return t=Traffic_light::yellow; case Traffic_light::yellow: return t=Traffic_light::red; case Traffic_light::red: return t=Traffic_light::green; } } Traffic_light next = ++light; // next becomes Traffic_light::green If you don’t want to explicitly qualify enumerator names and want enumerator values to be ints (without the need for an explicit conversion), you can remove the class from enum class to get a ‘‘plain’’ enum.

Destructor }; Naturally, this interface is an abstract class: as far as representation is concerned, nothing (except the location of the pointer to the vtbl) is common for every Shape. push_back(s); } void set_mouth(Shape∗ s); virtual void wink(int i); // wink eye number i // ... private: vector eyes; Shape∗ mouth; }; // usually two eyes The push_back() member function adds its argument to the vector (here, eyes), increasing that vector’s size by one. We can now define Smiley::draw() using calls to Smiley’s base and member draw()s: void Smiley::draw() { Circle::draw(); for (auto p : eyes) p−>draw(); mouth−>draw(); } Note the way that Smiley keeps its eyes in a standard-library vector and deletes them in its destructor.

That is, simple operations (such as constructors, +=, and imag()) must be implemented without function calls in the generated machine code. Functions defined in a class are inlined by default. It is possible to explicitly require inlining by preceeding a function declaration with the keyword inline. An industrial-strength complex (like the standard-library one) is carefully implemented to do appropriate inlining. A constructor that can be invoked without an argument is called a default constructor.

Download PDF sample

Rated 4.92 of 5 – based on 9 votes