Programming In C - Pearsoncmg

2y ago
135 Views
2 Downloads
603.55 KB
62 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Gannon Casey
Transcription

Programming in CFourth Edition

Developer’s LibraryESSENTIAL REFERENCES FOR PROGRAMMING PROFESSIONALSDeveloper’s Library books are designed to provide practicing programmers with unique,high-quality references and tutorials on the programming languages and technologiesthey use in their daily work.All books in the Developer’s Library are written by expert technology practitioners whoare especially skilled at organizing and presenting information in a way that’s usefulfor other programmers.Key titles include some of the best, most widely acclaimed books within theirtopic areas:Programming in Objective-CStephen G. KochanISBN 978-0-321-96760-2Python Essential ReferenceDavid BeazleyISBN-13: 978-0-672-32978-4MySQLPaul DuBoisISBN-13: 978-0-321-83387-7PostgreSQLKorry DouglasISBN-13: 978-0-672-32756-8Linux Kernel DevelopmentRobert LoveISBN-13: 978-0-672-32946-3C Primer PlusStephen PrataISBN-13: 978-0-321-77640-2Developer’s Library books are available in print and in electronic formats at most retailand online bookstores, as well as by subscription from Safari Books Online at m/devlibrary

Programming in CFourth EditionStephen G. KochanUpper Saddle River, NJ Boston Indianapolis San FranciscoNew York Toronto Montreal London Munich Paris MadridCape Town Sydney Tokyo Singapore Mexico City

Programming in C, Fourth EditionCopyright 2015 by Pearson Education, Inc.All rights reserved. No part of this book shall be reproduced, stored in a retrievalsystem, or transmitted by any means, electronic, mechanical, photocopying, recording, orotherwise, without written permission from the publisher. No patent liability is assumedwith respect to the use of the information contained herein. Although every precautionhas been taken in the preparation of this book, the publisher and author assume noresponsibility for errors or omissions. Nor is any liability assumed for damages resultingfrom the use of the information contained herein.ISBN-13: 978-0-321-77641-9ISBN-10: 0-321-77641-0Library of Congress Control Number: 2014944082Printed in the United States of AmericaFirst Printing: August 2014TrademarksAll terms mentioned in this book that are known to be trademarks or service markshave been appropriately capitalized. The publisher cannot attest to the accuracy of thisinformation. Use of a term in this book should not be regarded as affecting the validity ofany trademark or service mark.Warning and DisclaimerEvery effort has been made to make this book as complete and as accurate as possible,but no warranty or fitness is implied. The information provided is on an “as is” basis. Theauthor and the publisher shall have neither liability nor responsibility to any person orentity with respect to any loss or damages arising from the information contained in thisbook.Special SalesFor information about buying this title in bulk quantities, or for special sales opportunities(which may include electronic versions; custom cover designs; and content particular toyour business, training goals, marketing focus, or branding interests), please contact ourcorporate sales department at corpsales@pearsoned.com or (800) 382-3419.For government sales inquiries, please contact governmentsales@pearsoned.com.For questions about sales outside the U.S., please contact international@pearsoned.com.AcquisitionsEditorMark TaberManaging EditorSandra SchroederProject EditorMandie FrankCopy EditorCharlotte KughenIndexerBrad HerrimanProofreaderDebbie WilliamsTechnical EditorSiddhartha SinghEditorial AssistantVanessa EvansDesignerChuti PrasertsithCompositorMary Sudul

For my mother and father

viContentsContents at a GlanceIntroduction11 Some Fundamentals52 Compiling and Running Your First Program 113 Variables, Data Types, and Arithmetic Expressions 214 Program Looping 435 Making Decisions656 Working with Arrays 957 Working with Functions 1198 Working with Structures9 Character Strings16319310 Pointers 23311 Operations on Bits12 The Preprocessor27729713 Extending Data Types with the Enumerated Data Type,Type Definitions, and Data Type Conversions 31914 Working with Larger Programs 33115 Input and Output Operations in C34516 Miscellaneous and Advanced Features 37317 Debugging Programs39118 Object-Oriented Programming 413

ContentsA C Language SummaryB The Standard C Library427471C Compiling Programs with gcc495D Common Programming MistakesE ResourcesIndex509505499vii

Table of ContentsIntroduction 11 Some Fundamentals5Programming 5Higher-Level Languages 5Operating Systems 6Compiling Programs 7Integrated Development Environments 10Language Interpreters102 Compiling and Running Your First Program 11Compiling Your Program 12Running Your Program 12Understanding Your First Program 13Displaying the Values of Variables 15Comments 17Exercises 193 Variables, Data Types, and Arithmetic Expressions21Understanding Data Types and Constants 21The Integer Type int 22The Floating Number Type float 23The Extended Precision Type double 23The Single Character Type char 24The Boolean Data Type Bool 24Type Specifiers: long, long long, short, unsigned, and signed 26Working with Variables 29Working with Arithmetic Expressions 30Integer Arithmetic and the Unary Minus Operator 33Combining Operations with Assignment: The Assignment Operators 39Types Complex and Imaginary 40Exercises 40

Contents4 Program Looping43Triangular Numbers 43The for Statement44Relational Operators 46Aligning Output 50Program Input51Nested for Loops53for Loop Variants55The while Statement56The do Statement60The break Statement62The continue Statement62Exercises 635 Making Decisions65The if Statement65The if-else Construct69Compound Relational TestsNested if StatementsThe else if ConstructThe switch StatementBoolean Variables7274768386The Conditional Operator90Exercises 926 Working with Arrays95Defining an Array 96Using Array Elements as Counters 100Generating Fibonacci Numbers 103Using an Array to Generate Prime Numbers 104Initializing Arrays 106Character Arrays 108Base Conversion Using Arrays 109The const Qualifier111Multidimensional Arrays 113Variable Length Arrays 115Exercises 117ix

xContents7 Working with Functions119Defining a Function 119Arguments and Local Variables 123Function Prototype Declaration 124Automatic Local Variables 124Returning Function Results 126Functions Calling Functions Calling. 130Declaring Return Types and Argument Types 133Checking Function Arguments 135Top-Down Programming 137Functions and Arrays 137Assignment Operators 141Sorting Arrays 143Multidimensional Arrays 146Global Variables 151Automatic and Static Variables 155Recursive Functions 158Exercises 1618 Working with Structures163The Basics of Structures 163A Structure for Storing the Date 164Using Structures in Expressions 166Functions and Structures 169A Structure for Storing the Time 175Initializing Structures 178Compound Literals 178Arrays of Structures 180Structures Containing Structures 183Structures Containing Arrays 185Structure Variants 189Exercises 1909 Character Strings193Revisiting the Basics of Strings 193Arrays of Characters 194

ContentsVariable-Length Character Strings 197Initializing and Displaying Character Strings 199Testing Two Character Strings for Equality 202Inputting Character Strings 204Single-Character Input 206The Null String 211Escape Characters215More on Constant Strings217Character Strings, Structures, and Arrays 218A Better Search Method221Character Operations 226Exercises 22910 Pointers233Pointers and Indirection 233Defining a Pointer Variable 234Using Pointers in Expressions 237Working with Pointers and Structures 239Structures Containing Pointers 241Linked Lists 243The Keyword const and PointersPointers and FunctionsPointers and Arrays251252258A Slight Digression About Program OptimizationIs It an Array or Is It a Pointer?Pointers to Character Strings262262264Constant Character Strings and Pointers266The Increment and Decrement Operators Revisited 267Operations on Pointers 271Pointers to Functions 272Pointers and Memory Addresses 273Exercises 27511 Operations on Bits277The Basics of Bits 277Bit Operators 278The Bitwise AND Operator 279xi

xiiContentsThe Bitwise Inclusive-OR Operator 281The Bitwise Exclusive-OR Operator 282The Ones Complement Operator 283The Left Shift Operator 285The Right Shift Operator 286A Shift Function 286Rotating Bits 288Bit Fields 291Exercises 29512 The Preprocessor297The #define Statement297Program Extendability301Program Portability302More Advanced Types of DefinitionsThe # OperatorThe ## Operator304309310The #include Statement311System Include Files313Conditional Compilation 314The #ifdef, #endif, #else, and #ifndef StatementsThe #if and #elif Preprocessor StatementsThe #undef Statement314316317Exercises 31813 Extending Data Types with the Enumerated Data Type, Type Definitions, and DataType Conversions 319Enumerated Data Types 319The typedef StatementData Type ConversionsSign Extension323325327Argument Conversion 328Exercises 32914 Working with Larger Programs331Dividing Your Program into Multiple Files 331Compiling Multiple Source Files from the Command Line 332

ContentsCommunication Between Modules 334External Variables 334Static Versus Extern Variables and FunctionsUsing Header Files Effectively339Other Utilities for Working with Larger ProgramsThe make UtilityThe cvs Utility341341343Unix Utilities: ar, grep, sed, and so on15 Input and Output Operations in C343345Character I/O: getchar() and putchar() 346Formatted I/O: printf() and scanf() 346The printf() FunctionThe scanf() Function346353Input and Output Operations with FilesRedirecting I/O to a FileEnd of File358358361Special Functions for Working with FilesThe fopen FunctionThe getc() and putc() FunctionsThe feof Function362362The fclose() Function364365367The fprintf() and fscanf() FunctionsThe fgets() and fputs() Functionsstdin, stdout, and stderrThe exit() Function367367368369Renaming and Removing Files370Exercises 37116 Miscellaneous and Advanced Features373Miscellaneous Language Statements 373The goto StatementThe null StatementWorking with UnionsThe Comma OperatorType Qualifiers373374375378379The register Qualifier379337xiii

xivContentsThe volatile Qualifier379The restrict Qualifier379Command-line Arguments 380Dynamic Memory Allocation 384The calloc() and malloc() FunctionsThe sizeof OperatorThe free Function385385387Exercises 38917 Debugging Programs391Debugging with the Preprocessor 391Debugging Programs with gdb 397Working with Variables 400Source File Display 401Controlling Program Execution 402Getting a Stack Trace 406Calling Functions and Setting Arrays and Structures 407Getting Help with gdb CommandsOdds and Ends40841018 Object-Oriented Programming413What Is an Object Anyway? 413Instances and Methods 414Writing a C Program to Work with Fractions 416Defining an Objective-C Class to Work with Fractions 417Defining a C Class to Work with Fractions 421Defining a C# Class to Work with Fractions 424A C Language Summary4271.0 Digraphs and Identifiers 4272.0 Comments 4293.0 Constants 4294.0 Data Types and Declarations 4325.0 Expressions 4426.0 Storage Classes and Scope 4567.0 Functions 4588.0 Statements 4609.0 The Preprocessor 464

ContentsB The Standard C Library471Standard Header Files 471String Functions 474Memory Functions 475Character Functions 476I/O Functions 477In-Memory Format Conversion Functions 482String-to-Number Conversion 483Dynamic Memory Allocation Functions 484Math Functions 485General Utility Functions 493C Compiling Programs with gcc495General Command Format 495Command-Line Options 496D Common Programming MistakesE Resources499505The C Programming Language505C Compilers and Integrated Development EnvironmentsMiscellaneous 507Index 509506xv

About the AuthorStephen G. Kochan has been developing software with the C programming language formore than 30 years. He is the author of several best-selling titles on the C language, includingProgramming in C, Programming in Objective-C, and Topics in C Programming. He has also writtenextensively on Unix and is the author or coauthor of Exploring the Unix System and Unix ShellProgramming.Contributing Author, Fourth EditionDean Miller is a writer and editor with more than 20 years of experience in both thepublishing and licensed consumer products businesses. He is coauthor of the most recenteditions of Sams Teach Yourself C in One Hour a Day, and Sams Teach Yourself BeginningProgramming in 24 Hours.

AcknowledgmentsI wish to thank the following people for their help in the preparation of various versions of thistext: Douglas McCormick, Jim Scharf, Henry Tabickman, Dick Fritz, Steve Levy, Tony Ianinno,and Ken Brown. I also want to thank Henry Mullish of New York University for teaching me somuch about writing and for getting me started in the publishing business.At Pearson, I’d like to thank Mark Taber and my project editor Mandie Frank. Thanks also tomy copy editor, Charlotte Kughen, and my technical editor, Siddhartha Singh. Finally, I’d liketo thank all the other people from Pearson who were involved on this project, even if I did notwork with them directly.

We Want to Hear from You!As the reader of this book, you are our most important critic and commentator. We value youropinion and want to know what we’re doing right, what we could do better, what areas you’dlike to see us publish in, and any other words of wisdom you’re willing to pass our way.We welcome your comments. You can email or write directly to let us know what you did ordidn’t like about this book—as well as what we can do to make our books better.Please note that we cannot help you with technical problems related to the topic of this book, and thatdue to the high volume of mail we receive, we might not be able to reply to every message.When you write, please be sure to include this book’s title and author, as well as your nameand phone number or email :Reader FeedbackAddison-Wesley Developer’s Library800 East 96th StreetIndianapolis, IN 46240 USAReader ServicesVisit our website and register this book at www.informit.com/register for convenient access toany updates, downloads, or errata that might be available for this book.

IntroductionThe C programming language was pioneered by Dennis Ritchie at AT&T Bell Laboratories in theearly 1970s. It was not until the late 1970s, however, that this programming language began togain widespread popularity and support. This was because until that time C compilers were notreadily available for commercial use outside of Bell Laboratories. Initially, C’s growth in popularity was also spurred on in part by the equal, if not faster, growth in popularity of the Unixoperating system. This operating system, which was also developed at Bell Laboratories, had Cas its “standard” programming language. In fact, well over 90% of the operating system itselfwas written in the C language!The enormous success of the IBM PC and its look-alikes soon made MS-DOS the most popularenvironment for the C language. As C grew in popularity across different operating systems,more and more vendors hopped on the bandwagon and started marketing their own C compilers. For the most part, their version of the C language was based on an appendix found inthe first C programming text—The C Programming Language—by Brian Kernighan and DennisRitchie. Unfortunately, this appendix did not provide a complete and unambiguous definitionof C, meaning that vendors were left to interpret some aspects of the language on their own.In the early 1980s, a need was seen to standardize the definition of the C language. The AmericanNational Standards Institute (ANSI) is the organization that handles such things, so in 1983 anANSI C committee (called X3J11) was formed to standardize C. In 1989, the committee’s workwas ratified, and in 1990, the first official ANSI standard definition of C was published.Because C is used around the world, the International Standard Organization (ISO) soon gotinvolved. They adopted the standard, where it was called ISO/IEC 9899:1990. Since that time,additional changes have been made to the C language. The most recent standard was adoptedin 2011. It is known as ANSI C11, or ISO/IEC 9899:2011. It is this version of the language uponwhich this book is based.C is a “higher-level language,” yet it provides capabilities that enable the user to “get inclose” with the hardware and deal with the computer on a much lower level. This is because,although C is a general-purpose structured programming language, it was originally designedwith systems programming applications in mind and, as such, provides the user with an enormous amount of power and flexibility.

2IntroductionThis book proposes to teach you how to program in C. It assumes no previous exposure to thelanguage and was designed to appeal to novice and experienced programmers alike. If you haveprevious programming experience, you will find that C has a unique way of doing things thatprobably differs from other languages you have used.Every feature of the C language is treated in this text. As each new feature is presented, a smallcomplete program example is usually provided to illustrate the feature. This reflects the overriding philosophy that has been used in writing this book: to teach by example. Just as a pictureis worth a thousand words, so is a properly chosen program example. If you have access to acomputer that supports the C programming language, you are strongly encouraged to download and run each program presented in this book and to compare the results obtained on yoursystem to those shown in the text. By doing so, not only will you learn the language and itssyntax, but you will also become familiar with the process of typing in, compiling, and runningC programs.You will find that program readability has been stressed throughout the book. This is becauseI strongly believe that programs should be written so that they can be easily read—either bythe author or by somebody else. Through experience and common sense, you will find thatsuch programs are almost always easier to write, debug, and modify. Furthermore, developingprograms that are readable is a natural result of a true adherence to a structured programmingdiscipline.Because this book was written as a tutorial, the material covered in each chapter is based onpreviously presented material. Therefore, maximum benefit will be derived from this book byreading each chapter in succession, and you are highly discouraged from “skipping around.”You should also work through the exercises that are presented at the end of each chapter beforeproceeding on to the next chapter.Chapter 1, “Some Fundamentals,” which covers some fundamental terminology about higherlevel programming languages and the process of compiling programs, has been included toensure that you understand the language used throughout the remainder of the text. FromChapter 2, “Compiling and Running Your First Program,” on, you will be slowly introduced tothe C language. By the time Chapter 15, “Input and Output Operations in C,” rolls around, allthe essential features of the language will have been covered. Chapter 15 goes into more depthabout I/O operations in C. Chapter 16, “Miscellaneous and Advanced Features,” includes thosefeatures of the language that are of a more advanced or esoteric nature.Chapter 17, “Debugging Programs,” shows how you can use the C preprocessor to help debugyour programs. It also introduces you to interactive debugging. The popular debugger gdb waschosen to illustrate this debugging technique.Over the last decade, the programming world has been abuzz with the notion of objectoriented programming, or OOP for short. C is not an OOP language; however, several otherprogramming languages that are based on C are OOP languages. Chapter 18, “Object-orientedProgramming,” gives a brief introduction to OOP and some of its terminology. It also gives abrief overview of three OOP languages that are based on C, namely C , C#, and Objective-C.

IntroductionAppendix A, “C Language Summary,” provides a complete summary of the language and isprovided for reference purposes.Appendix B, “The Standard C Library,” provides a summary of many of the standard libraryroutines that you will find on all systems that support C.Appendix C, “Compiling Programs with gcc,” summarizes many of the commonly usedoptions when compiling programs with GNU’s C compiler gcc.In Appendix D, “Common Programming Mistakes,” you’ll find a list of common programmingmistakes.Finally, Appendix E, “Resources,” provides a list of resources you can turn to for more information about the C language and to further your studies.This book makes no assumptions about a particular computer system or operating system onwhich the C language is implemented. The text makes brief mention of how to compile andexecute programs using the popular GNU C compiler gcc.3

This page intentionally left blank

3Variables, Data Types, andArithmetic ExpressionsThe true power of programs you create is their manipulation of data. In order to truly takeadvantage of this power, you need to better understand the different data types you can use, aswell as how to create and name variables. C has a rich variety of math operators that you canuse to manipulate your data. In this chapter you will cover: The int, float, double, char, and Bool data types Modifying data types with short, long, and long long The rules for naming variables Basic math operators and arithmetic expressions Type castingUnderstanding Data Types and ConstantsYou have already been exposed to the C basic data type int. As you will recall, a variabledeclared to be of type int can be used to contain integral values only—that is, values that donot contain decimal places.The C programming language provides four other basic data types: float, double, char, andBool. A variable declared to be of type float can be used for storing floating-point numbers(values containing decimal places). The double type is the same as type float, only withroughly twice the precision. The char data type can be used to store a single character, such asthe letter ’a’, the digit character ’6’, or a semicolon (’;’) (more on this later). Finally, the Booldata type can be used to store just the values 0 or 1. Variables of this type are used for indicating an on/off, yes/no, or true/false situation. These one-or-the-other choices are also known asbinary choices.In C, any number, single character, or character string is known as a constant. For example,the number 58 represents a constant integer value. The character string "Programming in C

22Chapter 3Variables, Data Types, and Arithmetic Expressionsis fun.\n" is an example of a constant character string. Expressions consisting entirely ofconstant values are called constant expressions. So, the expression128 7 - 17is a constant expression because each of the terms of the expression is a constant value. But if iwere declared to be an integer variable, the expression128 7 – iwould not represent a constant expression because its value would change based on the valueof i. If i is 10, the expression is equal to 125, but if i is 200, the expression is equal to 65.The Integer Type intIn C, an integer constant consists of a sequence of one or more digits. A minus sign precedingthe sequence indicates that the value is negative. The values 158, 10, and 0 are all valid examples of integer constants. No embedded spaces are permitted between the digits, and valueslarger than 999 cannot be expressed using commas. (So, the value 12,000 is not a valid integerconstant and must be written as 12000.)Two special formats in C enable integer constants to be expressed in a base other than decimal(base 10). If the first digit of the integer value is a 0, the integer is taken as expressed in octalnotation—that is, in base 8. In that case, the remaining digits of the value must be valid base-8digits and, therefore, must be 0–7. So, to express the value 50 in base 8 in C, which is equivalent to the value 40 in decimal, the notation 050 is used. Similarly, the octal constant 0177represents the decimal value 127 (1 64 7 8 7). An integer value can be displayed at theterminal in octal notation by using the format characters %o in the format string of a printf()statement. In such a case, the value is displayed in octal without a leading zero. The formatcharacter %#o does cause a leading zero to be displayed before an octal value.If an integer constant is preceded by a zero and the letter x (either lowercase or uppercase), thevalue is taken as being expressed in hexadecimal (base 16) notation. Immediately following theletter x are the digits of the hexadecimal value, which can be composed of the digits 0–9 andthe letters a–f (or A–F). The letters represent the values 10–15, respectively. So, to assign thehexadecimal value FFEF0D to an integer variable called rgbColor, the statementrgbColor 0xFFEF0D;can be used. The format characters %x display a value in hexadecimal format without theleading 0x, and using lowercase letters a–f for hexadecimal digits. To display the value with theleading 0x, you use the format characters %#x, as in the following:printf ("Color is %#x\n", rgbColor);An uppercase x, as in %X or %#X, can be used to display the leading x and the hexadecimaldigits that follow using uppercase letters.

Understanding Data Types and ConstantsStorage Sizes and RangesEvery value, whether it’s a character, integer, or floating-point number, has a range of valuesassociated with it. This range has to do with the amount of storage that is allocated to storea particular type of data. In general, that amount is not defined in the language. It typicallydepends on the computer you’re running, and is, therefore, called implementation- or machinedependent. For example, an integer might take up 32 bits on your computer, or perhaps itmight be stored in 64. You should never write programs that make any assumptions about thesize of your data types. You are, however, guaranteed that a minimum amount of storage willbe set aside for each basic data type. For example, it’s guaranteed that an integer value will bestored in a minimum of 32 bits of storage, which is the size of a “word” on many computers.The Floating Number Type floatA variable declared to be of type float can be used for storing values containing decimalplaces. A floating-point constant is distinguished by the presence of a decimal point. Youcan omit digits before the decimal point or digits after the decimal point, but obviously youcan’t omit both. The values 3., 125.8, and .0001 are all valid examples of floating-pointconstants. To display a floating-point value at the terminal, the printf conversion characters%f are used.Floating-point constants can also be expressed in scientific notation. The value 1.7e4 is afloating-point value expressed in this notation and represents the value 1.7 104. The valuebefore the letter e is known as the mantissa, whereas the value that follows is called the exponent. This exponent, which can be preceded by an optional plus or minus sign, represents thepower of 10 by which the mantissa is to be multiplied. So, in the constant 2.25e 3, the 2.25is the value of the mantissa and 3 is the value of the exponent. This constant represents thevalue 2.25 10 3, or 0.00225. Incidentally, the letter e, which separates the mantissa fromthe exponent, can be written in either lowercase or uppercase.To display a value in scientific notation, the format characters %e should be specified in theprintf() format string. The printf() format characters %g can be used to let printf()decide whether to display the floating-point value in normal floating-point notation or inscientific notation. This decision is based on the value of the exponent: If it’s less than 4 orgreater than 5, %e (scientific notation) format is used; otherwise, %f format is used.Use the %g format characters for displaying floating-point numbers—it produces the mostaesthetically pleasing output.A hexadecimal floating constant consists of a leading 0x or 0X, followed by one or moredecimal or hexadecimal digits, followed by a p or P, followed by an optionally signed binaryexponent. For example, 0x0.3p10 represents the value 3/16 210 0.5.The Extended Precision Type doubleThe double type is very similar to the float type, but it is used whenever the range providedby a float variable is not sufficient. Variables declared to be of type double can store roughly23

24Chapter 3Variables, Data Types, and Arithmetic Expressionstwice as many significant digits as can a variable of type float. Most computers representdouble values using 64 bits.Unless told otherwise, all floating-point constants are taken as double values by the Ccompiler. To explicitly express a float constant, append either an f or F to the end of thenumber, as follows:12.5fTo display a double value, the format characters %f, %e, or %g, which are the same format characters used to display a float value, can be used.The Single Character Type charA char variable can be used to store a single character.1 A character constant is formed byenclosing the character within a pair of single quotation marks. So 'a', ';', and '0' are allvalid examples of character constants. The first constant represents the letter a, the second is asemicolon, and the third is the character zero—which is not the same as the number zero. Donot confuse a character constant, which is a single character enclosed in single quotes, with acharacter string, which is any number of characters enclosed in double quotes.The character constant '\n'—the newline character—is a valid character constant even thoughit seems to contradict the rule cited previously. This is because the backslash character is aspecial chara

Python Essential Reference David Beazley ISBN-13: 978-0-672-32978-4 PostgreSQL Korry Douglas ISBN-13: 978-0-672-32756-8 C Primer Plus Stephen Prata ISBN-13: 978-0-321-77640-2 Developer’s Library books are available in print and in electronic formats at most retail and online bookstores, a

Related Documents:

Object Oriented Programming 7 Purpose of the CoursePurpose of the Course To introduce several programming paradigms including Object-Oriented Programming, Generic Programming, Design Patterns To show how to use these programming schemes with the C programming language to build “good” programs.

Functional programming paradigm History Features and concepts Examples: Lisp ML 3 UMBC Functional Programming The Functional Programming Paradigm is one of the major programming paradigms. FP is a type of declarative programming paradigm Also known as applicative programming and value-oriented

1 1 Programming Paradigms ØImperative Programming – Fortran, C, Pascal ØFunctional Programming – Lisp ØObject Oriented Programming – Simula, C , Smalltalk ØLogic Programming - Prolog 2 Parallel Programming A misconception occurs that parallel

About this Programming Manual The PT Programming Manual is designed to serve as a reference to programming the Panasonic Hybrid IP-PBX using a Panasonic proprietary telephone (PT) with display. The PT Programming Manual is divided into the following sections: Section 1, Overview Provides an overview of programming the PBX. Section 2, PT Programming

Programming paradigms Structured programming: all programs are seen as composed of control structures Object-oriented programming (OOP): Java, C , C#, Python Functional programming: Clojure, Haskell Logic programming based on formal logic: Prolog, Answer set programming (ASP), Datalog

Programming is the key word here because you make the computer do what you want by programming it. Programming is like putting the soul inside a body. This book intends to teach you the basics of programming using GNU Smalltalk programming language. GNU Smalltalk is an implementation of the Smalltalk-80 programming language and

source programming languages and databases, Linux programming, Microsoft, and Java, to Web development, social networking platforms, Mac/iPhone programming, and Android programming. Visit developers-library.com for a complete list of available products Developer's Library Series

Addison-Wesley Professional Computing Series Brian W. Kernighan, Consulting Editor Matthew H. Austern, Generic Programming and the STL:Using and Extending the C Standard Template Library David R. Butenhof, Programming with POSIX Threads Brent Callaghan, NFS Illustrated Tom Cargill, C Programming Style William R. Cheswick/Steven M. Bellovin/Aviel D. Rubin, Firewalls and Internet Security .