C++ in Action, w. CD-ROM: Industrial-strength Programming by Bartosz Milewski

By Bartosz Milewski

(Pearson schooling) glossy consultant to utilizing C++ langugage, together with tips on how to use it on home windows programming. exhibits find out how to write courses for programmers, now not pcs. The CD-ROM good points the entire resource code and initiatives from the textual content. additionally features a spouse site. process specifications no longer indexed. Softcover.

Show description

Read Online or Download C++ in Action, w. CD-ROM: Industrial-strength Programming Techniques PDF

Best programming: programming languages books

Objektorientierte Programmiersprache C++: Vollständige Einführung anhand von Beispielen (VDI-Buch) (German Edition)

In diesem Werk werden alle Aspekte der Sprache C++ behandelt, deshalb ist das Buch ebenso für Einsteiger, mit oder ohne Vorkenntnisse über eine andere Programmiersprache, als auch für Umsteiger von anderen Programmiersprachen bzw. C-Programmierer geeignet. Die Darstellung der Sachverhalte erfolgt knapp und systematisch, die Beispiele sind kurz, prägnant und compiler- unabhängig und auf allen Rechnern mit C++ 2.

Extra resources for C++ in Action, w. CD-ROM: Industrial-strength Programming Techniques

Sample text

In other sciences a lot of progress was made through natural attrition. The computer revolution happened well within one generation. Granted, a lot of programmers made enough money to be able to afford doing volunteer work for the rest of their lives. Still, many others are carrying around their old (although only a few years old) bag of tricks that they learned when they were programming XT’s with 64k memory. " It’s a great book, don’t get me wrong, but it teaches the programming style of the times long gone.

In our example i will change its value to 10. Conversely, *pValue = 20; will change the value that pValue points to, that is, the value of TheValue. (The value of TheValue will now be 20). As you can see, this is a little bit more complicated than the use of references. By the way, the same example with references would look like this: int TheValue = 10; int& aliasValue = TheValue; // aliasValue refers to TheValue int i = aliasValue; // access TheValue through an alias aliasValue = 20; // change TheValue through an alias References definitely win the simplicity competition.

The solution is either to separate error codes from references, or to use exceptions (see the chapter on resource management) to signal abnormal conditions. Of course, there is nothing wrong with functions that return pointers by design and use the null-pointer trick to signal special conditions. There is an opposing school of thought about dealing with pointers—fighting fire with fire. Some object oriented languages, notably Java, use pointers as the only way of accessing objects. The trick is—they don’t allow C-style manipulation of pointers.

Download PDF sample

Rated 4.02 of 5 – based on 18 votes