`
`
`
`
`
`I +
`
`;U
`
`CJJU)
`_o
`L-
`G.)
`_c
`
`w
`2
`"5
`El
`
`E
`U
`
`SYMANTEC Exhibit 1030 Page 1
` SYMANTEC
` Exhibit 1030 Page 1
`
`
`
`Osborne McGraw-Hill
`2600 Tenth Street
`
`Berkeley, California 94710
`U.S.A.
`
`For information on translations or book distributors outside of the U.S.A.,
`please write to Osborne McGraw-Hill at the above address.
`
`C++ from the Ground Up
`
`Copyright © 1994 by McGraw—Hill. All rights reserved. Printed in the United
`States of America. Except as permitted under the Copyright Act of 1976, no
`part of this publication may be reproduced or distributed in any form or by
`any means, or stored in a database or retrieval system, without the prior
`written permission of the publisher, with the exception that the program
`listings may be entered, stored, and executed in a computer system, but they
`may not be reproduced for publication.
`567890 DOC 998765
`
`ISBN 0-07-881969-5
`
`Publisher
`Lawrence Levitsky
`
`Acquisitions Editor
`Jeff Pepper
`
`Project Editor
`Nancy McLaughlin
`
`Technical Editor
`James Turley
`Proofreader
`Audrey Baerjohnson
`
`Computer Designer
`Marcela V. Hancik
`
`Quality Control Specialist
`Joe Scuderi
`
`Illustrator
`Rhys Elliott
`
`Interior Designer
`Marla Shelasky
`Indexer
`Sheryl Schildt
`
`Int;
`
`T}
`
`1
`
`Cover Design
`Ted Mader Associates
`
`,
`2 25????‘ Al
`
`Information has been obtained by Osborne McGraw-Hill from S0l1l(‘C:s believed to be reliable. However, because of the
`possibility of human or rut-(hanical error by our sources, Osborne Mc(iraw~Hill, or others, Osborne Mcfiraw-Hill does not
`guarantee the accuracy, adequacy, or completeness of any information and is not responsible tor any errors or omissions or the
`results obtained from use of such information.
`
`SYMANTE
`
`
`
` Exhibit 1030 Page 2 SYMANTEC
`
`
`
`
`
`“mun! Up
`
`«in()i'erviewof(.‘++
`
`21 ‘
`
`it
`
`ies. (Of
`
`ISL‘ ii
`
`tion’s
`sed in
`-om
`
`ier,
`run, and
`tions
`
`main()
`
`rl Iilimry.
`
`erally
`impiler.
`t
`
`|c().
`),
`IL‘ SCTCCII.
`
`cout <<
`
`Inside myfunc()
`
`;
`
`The program works like this. l-'irst, main() begins, and it executes the
`first cout statement. Next, main() calls myfunc( ). Notice how this is
`achieved: the function’s name, myfunc, appears, followed by parentheses,
`and finally by a semicolon. A function call is a tZ++ statement and, therefore,
`must end with a semicolon. Next, myfunc() executes its cout statement,
`and then returns to main() at the line of code immediately following the
`call. I-inally, main() executes its second cout statement and then
`terminates. Hence, the output on the screen is this:
`
`-mamas.’
`
`In maint ) lnside myfunct J Back in main( )
`
`There is one other important statement in the preceding program:
`
`Void myfunC( );
`
`// myfunc’s prototype
`
`"totlyprt
`
`‘T an prim‘
`'
`first
`
`As the comment states, this is the ])I'()l()I)’[)(’ for myfunc( ). Although we
`will discuss prototypes in detail later in this book, a few words are necessary
`now. .-\ function prototype declares the function prior to its definition. The
`prototype allows the compiler to know the function’s return type, as well
`as the number and type of any parameters that the function may have. The
`compiler needs to know this information prior to the first time the function
`is called. This is why the prototype occurs before n1ain( ).
`
`As you can see, n1yfunc() does not contain a return statement. The
`keyword void, which precedes both the prototype for myfunc() and its
`definition, formally states that myfunc() does not return a value. in C++,
`functions that don’t return values are declared as void.
`
`’ _1"‘glJt‘rl(’.t‘:i;
`:1 .aiue
`-4
`{yea to A
`Ti/on vvher
`—: gallrcici.
`
`Function Arguments
`it is possible to pass one or more values to a function. A value passed to a
`function is called an (Il},’Il1lI(’I1f. in the programs‘ that you have studied so
`far, none of the functions take any argurnents. Specifically, neither n1ain()
`nor myfunc() in the preceding examples have an argument. However,
`functions in (I++ can have anywhere from no arguments at all to many
`arguinents. The upper limit is determined by the compiler you are using, but
`the proposed (i++ standard specifies that a function must he able to take at
`least 256 argtinients.
`
`Here is a short program that uses one of (I++’s standard library (i.e., built-in)
`functions, called abs( ), to display the absolute value of number. The ahs()
`
`SYMANTEC Exhibit 1030 Page 3
` Exhibit 1030 Page 3 SYMANTEC
`
`
`
`
`C++ from the Ground Up
`
`An Overview of(
`
`//
`
`#in
`
`voi
`
`mai
`
`patui
`
`In
`
`se]
`co
`
`Fl
`.\l.
`ex
`
`ar;
`
`function takes one argument, converts it into its absolute value, and returns
`the result.
`
`// Use the abs() function.
`#include <iostream.h>
`#include <stdlib.h> // required by abs()
`
`main()
`{
`
`cout << abs(—l0);
`
`return 0;
`
`l H
`
`ere, the value -10 is passed as an argument to abs( ). The abs() function
`receives the argument that it is called with and returns its absolute value,
`which is 10 in this case. Although abs() takes only one argument, other
`functions can have several. The key point here is that when a function
`requires an argument, it is passed by specifying it between the parentheses
`that follow the function's name.
`
`The return value of abs() is used by the cout statement to display the absolute
`value of —1() on the screen. The reason this works is that whenever a function is
`
`part of a larger expression, it is automatically called so that its return Value can
`be obtained. In this case, the return value of abs() becomes the value of the
`right side of the << operator and is, therefore, displayed on the screen.
`
`Notice one other thing about the preceding program: it also includes the
`header file stdlib.h. This is the header file required by abs( ). In general,
`whenever you use a library function, you must include its header file. The
`header file provides the prototype for the library function, among other things.
`
`When you create a function that takes one or more arguments, the variables
`that will receive those arguments must also be declared. These variables are
`called the paranzcters of the function. For example, the function shown next
`prints the product of the two integer arguments used in the call to the function.
`
`void mul(int x,
`{
`
`int y)
`
`cout << X * y <<
`
`;
`
`} E
`
`ach time mul() is called, it will multiply the value passed to x by the value
`passed to y. Remember, however, that x and y are simply the operational
`variables that receive the values you use when calling the function.
`
`Consider the following short program, which illustrates how to call mul( ):
`
`/\ parameter
`is a variable
`
`defined by a
`funcfionthat
`receives an
`
`argument.
`
`
`
`SYMANTEC x I
` Exhibit 1030 Page 4
` SYMANTEC
`
`
`
`
`
`irozmd Up
`
`,—‘..rz Overview 0fC++
`
`23 ‘
`
`d returns
`
`// A simple program that demonstrates mul().
`
`#include <iostream.h>
`
`void mul(int x,
`
`int Y);
`
`// mul()'s prototype
`
`2
`
`main()
`{
`
`mul(10, 20);
`mul(5, 6);
`mul(8, 9);
`
`return 0;
`
`l v
`
`{
`
`oid mul(int x,
`
`int y)
`
`cout << x * y << " ";
`
`} T
`
`his program will print 200, 30, and 72 on the screen. When mul()
`is called, the C++ compiler copies the value of each argument into the
`matching parameter. That is, in the first call to mul( ), 10 is copied into x
`and 20 is copied into y. In the second call, 5 is copied into x and 6 into y.
`In the third call, 8 is copied into x and 9 into y.
`
`If you have never worked with a language that allows parameterized
`functions, then the preceding process may seem a bit strange. Don't worry;
`as you see more examples of C++ programs, the concept of arguments,
`parameters, and functions will become clear.
`
`
`
`Remember: The term argument refers to the Value that is used to call
`a function. The variable that receives the value of an argument is called a
`parameter. In fact, functions that take arguments are called parameterized
`functions.
` :28
`j%:\ l§1S;€§;»%§£¥E¥?C%5Lafia¥,:
`/.‘$’£i‘.:V?\:2-.~.-iw.
`zi4!>'a.-“>x».s¢«.1l‘:‘-W15’;
`-:'r2r«mw:'
`;
`::~ ~--‘V
`
`In C++ functions, when there are two or more arguments, they are
`separated by commas. In this book, the term argzmzcnt list will refer to
`comma-separated arguments. The argument list for mul() is x,y.
`
`Functions Returning Values
`Many of the C++ library functions that you will use return values. For
`example, the abs() function used earlier returned the absolute value of its
`argument. Also, functions you write may return Values to the calling routine.
`
`SYMANTEC Exhibit 1030 Page 5
` Exhibit 1030 Page 5 SYMANTEC
`
`
`inction
`
`Ialue,
`)'[h€f
`on
`itheses
`
`bsolute
`nction is
`lue can
`)f the
`
`; the
`
`ieral,
`. The
`
`‘ things.
`ariables
`les are
`In next
`unction.
`
`re Value
`mal
`
`lul( ):
`
`
`
`
`
` Skill Level
`
`Guide
`IB¢s"'-‘U
`
`E1"-"'~l"“~47‘””
`
`Programming C++
`
`You don’t need to be an
`expert in C to learn C++
`
`All you need to learn C++ is C++ from the Ground Up, written by master
`C++ programmer Herb Schildt. With C++ fast becoming the professional
`programmer's language of choice, you'll want to start programming in C++ as
`quickly as possible. Schildt understands this and gets right to the point in this
`fast—paced, no-nonsense guide to learning C++.
`
`As you may already know, C++ is built on the foundation of C. For this reason, Schildt teaches you just the C
`you'll need so you can quickly move on to the meat of C++, including its object-oriented features. Schildt's clear
`instructions, practical examples, and valuable tips put this book in a class by itself.
`
`Written in the clear, uncompromising style that has made
`Schi|dt's programming books the choice of millions
`worldwide, C++ from the Ground Up starts with an
`overview of C++ and the general form of a C++ program.
`You'll then progress to the fundamentals of C++
`programming, including control statements, operators,
`variables, expressions, and data types.
`
`j
`
`From this foundation, you'll then delve into:
`- Functions
`- Pointers and references
`
`- Inheritance
`° Virtual functions
`
`- Classes and objects
`- Function and operator overloading
`- Constructors and destructors
`- Templates
`' Exception handling
`
`' The C++ I/O system
`- The preprocessor
`- The principles behind Object-Oriented
`Programming (OOP)
`and much, much more.
`
`
`
`I!"
`CISBDR-NE iii:
`Get Answers—Get Osborne
`
`F0’ ACC“'3CYv QUa“tY- 3"d Value
`
`ISBN l]-D?-BBl‘ll::"l-5
`
`BYU BOOKSTORE
`C S290
`961
`
`lmsnnzanz
`
`
`lll
`
`
`
`
`
`
`
`
` lllll ii i
`
`
`
`101 0-07-881969-5
`
`I l
`
`
`
`
`
`$217.95
`
`Unlike other C++ programming books, C++ from the
`Ground Up adheres to the draft ANSI C++ standard, so
`you will be learning the most up-to-date specification of
`C++, the version supported by all major C++ compilers.
`Therefore, what you learn today will still apply tomorrow.
`
`If you're ready to start using the power and versatility
`of C++—whether you program in DOS, Windows. OS/2,
`Unix, or any other operating system—Schildt's C++
`from the Ground Up is the ideal book for you.
`
`
`
`$21.95 U.S.A.
`
`l
`i
`
`j
`
`T12
`
`l..l
`
`
`
`
`
`
`
`
`
`SYMANTEC Exhibit 1030 Page 6
` SYMANTEC
` Exhibit 1030 Page 6