Items related to Ivor Horton's Beginning C++ : The Complete Language...

Ivor Horton's Beginning C++ : The Complete Language ANSI/ISO Compliant (Wrox Beginning Series) - Softcover

  • 3.60 out of 5 stars
    20 ratings by Goodreads
 
9781861000125: Ivor Horton's Beginning C++ : The Complete Language ANSI/ISO Compliant (Wrox Beginning Series)

Synopsis

Beginning with the first steps in C++ programming, this guide discusses language constructs, object-oriented techniques, application writing, and syntax, with examples and exercises

"synopsis" may belong to another edition of this title.

About the Author

Ivor Horton, the best-selling author of Beginning Visual C++, Beginning C & Beginning Java has brought computer programming to a wide and varied audience. Ivor believes that programming is easier than it looks to people who haven't tried it, and he enjoys trying to make the subject more approachable for beginners. Ivor spent many years at IBM, both programming and training others to program

Excerpt. © Reprinted by permission. All rights reserved.

Chapter 2 Basic Data Types and Calculations

In this chapter we'll look at some of the basic data types that are built into C++, and that you're likely to use in all your programs. We'll also be investigating how you perform some simple numerical computation. All of C++'s object-oriented capability is founded on the basic data types built into the language, because all the data types you'll create are ultimately defined in terms of the basic types. It's therefore important to get a good grasp of using them. By the end of the chapter, you will be able to write a simple C++ program of the traditional form: input...process...output.

In this chapter, you will learn about:

Data types in C++
What literals are, and how you define them in a program
Binary and hexadecimal representation for integers
How you declare and initialize variables in your program
How calculations using integers work
Programming with values that are not integers - floating point calculations
How you can prevent the value stored in a variable from being modified
How to create variables that can store characters

Data and Data Types

C++ is a strongly typed language - in other words, every data item in your program has a type associated with it that defines what it is. Your C++ compiler will make extensive checks to ensure that, as far as possible, you use the right data type in any given context, and that when you combine different types they are made to be compatible. Because of this type checking, the compiler is able to detect and report most errors that would arise from the accidental interpretation of one type of data as another, or from attempts to combine data items of types that are mutually incompatible.

The numerical values that you can work with in C++ fall into two broad categories: integers (in other words, whole numbers), and floating point values (which can be fractional). You can't conclude from this that there are just two numerical data types, however. There are actually several data types in each of these categories, where each type has a permitted range of values that it can store. By way of explanation, let's look at how you carry out arithmetic calculations in C++, starting with how you can calculate using integers.

Performing Simple Calculations

To begin with, we can get some bits of terminology out of the way. An operation (such as a mathematical calculation) is defined by an operator - + for addition, for example, or * for multiplication. The values that an operator acts upon are called operands, so in an expression such as 2 * 3, the operands are 2 and 3.

Because the multiply operator requires two operands, it is called a binary operator. Some other operators only require one operand, and these are called unary operators. An example of a unary operator is the minus sign in -2. The minus sign acts on one operand - the value 2 - and changes its sign. This contrasts with the binary subtraction operator in expressions such as 4 - 2, which acts on two operands, the 4 and the 2.

Calculations involve operations on numbers, so a good starting point is to get a general idea of how you specify numeric values. In C++, fixed values of any kind, such as 42, or 2.71828, or "Mark Twain", are referred to as literals. In Chapter 1, when we were outputting text strings to the screen, we used a string literal - a constant defined by a series of characters between a pair of double quotes, of which "Mark Twain" is an example. Now we will investigate the types of literals that are numeric constants. These are the ordinary numbers you meet every day: your shoe size, the boiling point of lead, the number of angels that can sit on a pin - in fact, any defined number.

"About this title" may belong to another edition of this title.

Buy Used

Condition: Good
A sound copy with only light wear...
View this item

US$ 3.99 shipping within U.S.A.

Destination, rates & speeds

Other Popular Editions of the Same Title

Search results for Ivor Horton's Beginning C++ : The Complete Language...

Stock Image

Horton, Ivor
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Softcover

Seller: More Than Words, Waltham, MA, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Good. A sound copy with only light wear. Overall a solid copy at a great price! Seller Inventory # BOS-H-06i-01476

Contact seller

Buy Used

US$ 2.76
Convert currency
Shipping: US$ 3.99
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Horton, Ivor, Yaroshenko, Oleg
Published by Wrox Press Limited, 1998
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Softcover

Seller: Better World Books, Mishawaka, IN, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Good. 2nd. Used book that is in clean, average condition without any missing pages. Seller Inventory # 1597857-6

Contact seller

Buy Used

US$ 7.64
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 2 available

Add to basket

Stock Image

Ivor Horton
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Paperback

Seller: ThriftBooks-Dallas, Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Paperback. Condition: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 3.7. Seller Inventory # G186100012XI4N00

Contact seller

Buy Used

US$ 8.27
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Ivor Horton
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Paperback

Seller: ThriftBooks-Atlanta, AUSTELL, GA, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Paperback. Condition: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 3.7. Seller Inventory # G186100012XI4N00

Contact seller

Buy Used

US$ 8.27
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Ivor Horton
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Paperback

Seller: ThriftBooks-Dallas, Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Paperback. Condition: As New. No Jacket. Pages are clean and are not marred by notes or folds of any kind. ~ ThriftBooks: Read More, Spend Less 3.7. Seller Inventory # G186100012XI2N00

Contact seller

Buy Used

US$ 8.27
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Ivor Horton
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Paperback

Seller: ThriftBooks-Reno, Reno, NV, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Paperback. Condition: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 3.7. Seller Inventory # G186100012XI4N00

Contact seller

Buy Used

US$ 8.27
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Horton, Ivor
Published by Apress, 1998
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Paperback

Seller: HPB Inc., Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Paperback. Condition: Very Good. Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_413227008

Contact seller

Buy Used

US$ 5.00
Convert currency
Shipping: US$ 3.75
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Horton, Ivor
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used Softcover

Seller: Wonder Book, Frederick, MD, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Very Good. Very Good condition. A copy that may have a few cosmetic defects. May also contain light spine creasing or a few markings such as an owner's name, short gifter's inscription or light stamp. NOT AVAILABLE FOR SHIPMENT OUTSIDE OF THE UNITED STATES. Seller Inventory # I13C-01385

Contact seller

Buy Used

US$ 9.43
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Horton, Ivor
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used paperback

Seller: HPB-Ruby, Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

paperback. Condition: Very Good. Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_442100714

Contact seller

Buy Used

US$ 7.99
Convert currency
Shipping: US$ 3.75
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Horton, Ivor
Published by Apress, 1997
ISBN 10: 186100012X ISBN 13: 9781861000125
Used paperback

Seller: Half Price Books Inc., Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

paperback. Condition: Very Good. Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_446653433

Contact seller

Buy Used

US$ 9.99
Convert currency
Shipping: US$ 3.49
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

There are 9 more copies of this book

View all search results for this book