The Rook's Guide to C++ by Jeremy Hansen

By Jeremy Hansen

This inventive Commons-licensed textbook written via Norwich collage scholars and school goals to supply an advent to the C++ programming language. The Pdf and unique typesetting fabrics can be found when you are attracted to having a unfastened electronic reproduction of your individual or if you want to give a contribution to enhancing the booklet. Please stopover at rooksguide.org for extra information.

Show description

Read Online or Download The Rook's Guide to C++ PDF

Best computers & technology books

Amos 4.0 Users Guide

Publication by way of

High-Speed Design Techniques (Seminar Series)

Publication through Walt Kester

Imagining the Internet: Personalities, Predictions, Perspectives

Within the early Nineties, humans envisioned the loss of life of privateness, an finish to the present suggestion of "property," a paperless society, 500 channels of high-definition interactive tv, international peace, and the extinction of the human race after a takeover engineered by way of clever machines. Imagining the web zeroes in on predictions concerning the Internet's destiny and revisits earlier predictions--and how they became out--to positioned that imagined destiny in point of view.

Fundamentals of Power System Protection

Energy method is a hugely advanced dynamic entity. One malfunction or a slipshod set relay can jeopardize the full grid. energy procedure safety as an issue bargains the entire components of intrigue, drama, and suspense whereas dealing with fault stipulations in actual existence.

Additional info for The Rook's Guide to C++

Sample text

6. Add comments to the following code. 900 instead of 90%. # include # include u s i n g namespace s t d ; i n t main ( ) { double shots , goals , saves , save_perc ; char cont ; do { cout . unsetf ( ios : : f i x e d ) ; cout . u n s e t f ( i o s : : showpoint ) ; c o u t << ” E n t e r t h e number o f s h o t s on g o a l : \ t ” ; c i n >> s h o t s ; c o u t << ” E n t e r t h e number o f g o a l s s c o r e d : \ t ” ; c i n >> g o a l s ; c o u t << e n d l ; saves = shots − goals ; save_perc = ( saves / shots ) ; c o u t << ” I f t h e r e were ” << s h o t s << ” s h o t s and ” << g o a l s << ” g o a l s \ n ” ; c o u t << ” t h e n t h e g o a l i e ’ s s a v e p e r c e n t a g e was ” ; cout .

4. In fact, we can use scientific notation in conjunction with floating-point variables. e previous code that assigned a value to f can also be wrien as: f l o a t f = 3 3 5 e −2; / / S e t s f t o 3 . 3 5 Both float and double include a few special values that represent nonnumeric results, such as infinity, negative infinity, and NaN (Not a Number). 0 / 0 . 0; / / h i s set to negative i n f i n i t y float i = g / h; / / S i n c e i n f i n i t y d i v i d e d by n e g a t i v e i n f i n i t y i s / / undefined , the r e s u l t of the d i v i s i o n i s not a / / number , and i i s s e t t o NaN 2 is data type is found in the C++11 standard.

Int a , b , c ; a = 2; b = 8; c = 1; c = b − b; c = a + a; c = b * 8; b = b + b; c = a + c; b = a + b; a = a * c; b = a − c; c = b + a; c o u t << a << e n d l ; c o u t << b << e n d l ; c o u t << c << e n d l ; 5. What is the output of the following code? int a = 4 , b = 2 , a = b + 3; b ++; c = ( b + 4) * 2; c = c + 2; d = a + b − 3; a ++; a = a + 2 − b; b = b * 2; c o u t << ” a= ” << a c o u t << ” b= ” << b c o u t << ” c = ” << c c o u t << ” d= ” << d c , d; << << << << endl endl endl endl ; ; ; ; 6.

Download PDF sample

The Rook's Guide to C++ by Jeremy Hansen
Rated 4.20 of 5 – based on 44 votes