C Programming in easy steps, 4th edition
eBook - ePub

C Programming in easy steps, 4th edition

Updated for the GNU Compiler version 6.3.0 and Windows 10

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

C Programming in easy steps, 4th edition

Updated for the GNU Compiler version 6.3.0 and Windows 10

About this book

C Programming in easy steps, 5th edition has an easy-to-follow style that will appeal to anyone who wants to begin programming in C, from programmers moving from another programming language, to the student who is studying C programming at school or college, or to those seeking a career in computing who need a fundamental understanding of procedural programming.

C Programming in easy steps, 5th edition begins by explaining how to download and install a free C compiler so that you can quickly begin to create your own executable programs by copying the book's examples. You need have no previous knowledge of any programming language so it's ideal for the newcomer to computer programming. Each chapter builds your knowledge of C.

C Programming in easy steps, 5th edition contains separate chapters on the major features of the C language. There are complete example programs that demonstrate each aspect of C together with screenshots that illustrate the output when that program has been executed. The free, downloadable sample code provided via the In Easy Steps website all has coloured syntax-highlighting for clearer understanding.

By the end of this book you will have gained a sound understanding of the C language and be able to write your own C programs and compile them into executable files that can be run on any compatible computer.

Fully updated and revised since the fourth edition, which was published in April 2012 – now covers the GNU Compiler version 6.3.0 and Windows 10.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access C Programming in easy steps, 4th edition by Mike McGrath in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C. We have over one million books available in our catalogue for you to explore.
1
Getting Started
Welcome to the world of C. This chapter demonstrates how to create a C program in text, then how to compile it into executable byte form.
Introducing the C language
Installing a C compiler
Writing a C program
Compiling a C program
Understanding compilation
Summary
Introducing the C language
C is a compact, general-purpose computer programming language that was originally developed by Dennis MacAlistair Ritchie for the Unix operating system. It was first implemented on the Digital Equipment Corporation PDP-11 computer in 1972.
image
Dennis M Ritchie, creator of the C programming language.
This new programming language was named “C” as it succeeded an earlier programming language named “B” that had been introduced around 1970.
The Unix operating system and virtually all Unix applications are written in the C language. However, C is not limited to a particular platform and programs can be created on any machine that supports C, including those running the Windows platform.
The flexibility and portability of C made it very popular and the language was formalized in 1989 by the American National Standards Institute (ANSI). The ANSI standard unambiguously defined each aspect of C, thereby eliminating previous uncertainty about the precise syntax of the language.
ANSI C has become the recognized standard for the C language and is described, and demonstrated by examples, in this book.
Why learn C programming?
The C language has been around for quite some time and has seen the introduction of newer programming languages like Java, C++, and C#. Many of these new languages are derived, at least in part, from C – but are much larger in size. The more compact C is better to start out in programming because it’s simpler to learn.
It is easier to move on to learn the newer languages once the principles of C programming have been grasped. For instance, C++ is an extension of C and can be difficult to learn unless you have mastered C programming first.
Despite the extra features available in newer languages, C remains popular because it is versatile and efficient. It is used today on a large number of platforms, for everything from micro-controllers to the most advanced scientific systems. Programmers around the world embrace C because it allows them maximum control and efficiency in their programs.
image
Programs written 20 years ago in C are still just as valid today as they were back then.
Standard C libraries
ANSI C defines a number of standard libraries that contain tried-and-tested functions, which can be used in your own C programs.
The libraries are contained in “header files” that each has a file extension of “.h”. The names of the standard C library header files are listed in the table below with a description of their purpose:
Library:
Description:
stdio.h
Contains input and output functions, types, and macro definitions. This library is used by most C programs and represents almost one third of the entire C libraries
ctype.h
Contains functions for testing characters
string.h
Contains functions for manipulating strings
math.h
Contains mathematical functions
stdlib.h
Contains utility functions for number conversion, storage allocation, etc.
assert.h
Contains a function that can be used to add diagnostics to a program
stdarg.h
Contains a function that can be used to step through a list of function arguments
setjmp.h
Contains a function that can be used to avoid the normal call and return sequence
signal.h
Contains functi...

Table of contents

  1. Cover
  2. Title
  3. Copyright
  4. Contents
  5. Preface
  6. 1 Getting Started
  7. 2 Storing Variable Values
  8. 3 Setting Constant Values
  9. 4 Performing Operations
  10. 5 Making Statements
  11. 6 Employing Functions
  12. 7 Pointing to Data
  13. 8 Manipulating Strings
  14. 9 Building Structures
  15. 10 Producing Results
  16. + Reference Section
  17. Back Cover