Bøger / faglitteratur / vejledninger

Learn C Programming : a beginner's guide to learning the most powerful and general-purpose programming language with ease


Beskrivelse


The book takes you through basic programming concepts and shows you how to implement them in the C programming language. Throughout the book, you'll create and run programs that demonstrate essential C concepts, such as program structure with functions, control structures such as loops and conditional statements, and complex data structures.

Indhold

Seneste udgave,

Intro -- Title Page -- Copyright and Credits -- Dedication -- About Packt -- Contributors -- Table of Contents -- Preface -- Section 1: C Fundamentals -- Chapter 1: Running Hello, World! -- Technical requirements -- Writing your first C program -- Hello, world! -- Understanding the program development cycle -- Edit -- Compile -- Many C compilers for every OS -- A note about IDEs -- Installing a compiler on Linux, macOS, or Windows -- Run -- Verify -- Repeat -- A note about debugging -- Creating, typing, and saving your first C program -- Compiling your first C program -- Running your first C program -- Writing comments to clarify the program later -- Some guidelines on commenting code -- Adding comments to the Hello, world! program -- Learning to experiment with code -- Summary -- Chapter 2: Understanding Program Structure -- Technical requirements -- Introducing statements and blocks -- Experimenting with statements and blocks -- Understanding delimiters -- Understanding whitespace -- Introducing statements -- Introducing functions -- Understanding function definitions -- Exploring function identifiers -- Exploring the function block -- Exploring function return values -- Passing in values with function parameters -- Order of execution -- Understanding function declarations -- Summary -- Chapter 3: Working with Basic Data Types -- Technical requirements -- Understanding data types -- Bytes and chunks of data -- Representing whole numbers -- Representing positive and negative whole numbers -- Specifying different sizes of integers -- Representing numbers with decimals -- Representing single characters -- Representing Boolean true/false -- Understanding the sizes of data types -- The sizeof() operator -- Ranges of values -- Summary -- Chapter 4: Using Variables and Assignment -- Technical requirements -- Understanding types and values ; Introducing variables -- Naming variables -- Introducing explicit types of variables -- Using explicit typing with initialization -- Exploring constants -- Literal constants -- Defined values -- Explicitly typed constants -- Naming constant variables -- Using types and assignment -- Using explicit assignment, the simplest statement -- Assigning values by passing function parameters -- Assignment by the function return value -- Summary -- Chapter 5: Exploring Operators and Expressions -- Technical requirements -- Expressions and operations -- Introducing operations on numbers -- Considering the special issues resulting from operations on numbers -- Understanding NaN -- Understanding underflow NaN -- Understanding overflow NaN -- Considering precision -- Exploring type conversion -- Understanding implicit type conversion and values -- Using explicit type conversion - casting -- Introducing operations on characters -- Exploring logical and relational operators -- Bitwise operators -- The conditional operator -- The sequence operator -- Compound assignment operators -- Multiple assignments in a single expression -- Incremental operators -- Postfix versus prefix incrementation -- Order of operations and grouping -- Summary -- Chapter 6: Exploring Conditional Program Flow -- Technical requirements -- Understanding conditional expressions -- Introducing the if()… else…  complex statement -- Using a switch()… complex statement -- Introducing multiple if()… statements -- Using nested if()… else… statements -- The dangling else… problem -- Summary -- Chapter 7: Exploring Loops and Iteration -- Technical requirements -- Understanding repetition -- Understanding brute-force repetition -- Introducing the while()… statement -- Introducing the for()… statement -- Introducing the do … while() statement -- Understanding loop equivalency ; Understanding unconditional branching - the dos and (mostly) don'ts of goto -- Further controlling loops with break and continue -- Understanding infinite loops -- Summary -- Chapter 8: Creating and Using Enumerations -- Technical requirements -- Introducing enumerations -- Defining enumerations -- Using enumerations -- The switch()… statement revisited -- Summary -- Section 2: Complex Data Types -- Chapter 9: Creating and Using Structures -- Technical requirements -- Understanding structures -- Declaring structures -- Initializing structures and accessing structure elements -- Performing operations on structures - functions -- Structures of structures -- Initializing structures with functions -- Printing a structure of structures - reusing functions -- The stepping stone to object-oriented programming -- Summary -- Chapter 10: Creating Custom Data Types with typedef -- Technical requirements -- Renaming intrinsic types with typedef -- Using synonyms -- Simplifying the use of enum types with typedef -- Simplifying the use of struct types with typedef -- Other uses of typedef -- Some more useful compiler options -- Using a header file for custom types and the typedef specifiers -- Summary -- Chapter 11: Working with Arrays -- Technical requirements -- Declaring and initializing arrays -- Initializing arrays -- Accessing array elements -- Assigning values to array elements -- Operating on arrays with loops -- Using functions that operate on arrays -- Summary -- Chapter 12: Working with Multi-Dimensional Arrays -- Technical requirements -- Going beyond one-dimensional arrays to multi-dimensional arrays -- Revisiting one-dimensional arrays -- Moving on to two-dimensional arrays -- Moving on to three-dimensional arrays -- Considering N-dimensional arrays -- Declaring and initializing multi-dimensional arrays -- Declaring arrays of two dimensions ; Initializing arrays of two dimensions -- Declaring arrays of three dimensions -- Initializing arrays of three dimensions -- Declaring and initializing arrays of N dimensions -- Accessing elements of multi-dimensional arrays -- Manipulating multi-dimensional arrays - loops within loops -- Using nested loops to traverse a two-dimensional array -- Using nested loops to traverse a three-dimensional array -- Using multi-dimensional arrays in functions -- Summary -- Chapter 13: Using Pointers -- Technical requirements -- Addressing pointers - the boogeyman of C programming -- Why use pointers at all? -- Introducing pointers -- Understanding direct addressing and indirect addressing -- Understanding memory and memory addressing -- Managing and accessing memory -- Exploring some analogies in the real world -- Declaring the pointer type, naming pointers, and assigning addresses -- Declaring the pointer type -- Naming pointers -- Assigning pointer values (addresses) -- Operations with pointers -- Assigning pointer values -- Differentiating between the NULL pointer and void* -- Understanding the void* type -- Accessing pointer targets -- Pointer arithmetic -- Comparing pointers -- Verbalizing pointer operations -- Variable function arguments -- Passing values by reference -- Passing addresses to functions without pointer variables -- Pointers to pointers -- Using pointers to structures -- Accessing structures and their elements via pointers -- Using pointers to structures in functions -- Summary -- Chapter 14: Understanding Arrays and Pointers -- Technical requirements -- Understanding array names and pointers -- Understanding array elements and pointers -- Accessing array elements via pointers -- Operations on arrays using pointers -- Using pointer arithmetic -- Using the increment operator -- Passing arrays as function pointers revisited ; Interchangeability of array names and pointers -- Introducing an array of pointers to arrays -- Summary -- Chapter 15: Working with Strings -- Technical requirements -- Characters - the building blocks of strings -- The char type and ASCII -- Beyond ASCII - UTF-8 and Unicode -- Operations on characters -- Getting information about characters -- Manipulating characters -- Exploring C strings -- An array with a terminator -- Strengths of C strings -- Weaknesses of C strings -- Declaring and initializing a string -- String declarations -- Initializing strings -- Passing a string to a function -- Empty strings versus null strings -- Hello, World! revisited -- Creating and using an array of strings -- Common operations on strings - the standard library -- Common functions -- Safer string operations -- Summary -- Chapter 16: Creating and Using More Complex Structures -- Technical requirements -- Introducing the need for complex structures -- Revisiting card4.h -- Understanding an array of structures -- Creating an array of structures -- Accessing structure elements within an array -- Manipulating an array of structures -- Using a structure with other structures -- Creating a structure consisting of other structures -- Accessing structure elements within the structure -- Manipulating a structure consisting of other structures -- Using a structure with arrays -- Understanding randomness and random number generators -- Creating a structure with an array -- Accessing array elements within a structure -- Manipulating array elements within a structure -- Revisiting the hand structure -- Revisiting hand operations -- Using a structure with an array of structures -- Creating a structure with an array of structures -- Accessing individual structure elements of the array within a structure -- Manipulating a structure with an array of structures ; Completing carddeck.c


Tidsskrift

Artiklen er en del af

Artiklerne i  handler ofte om

Artikler med samme emner

Fra


Artikler

Alle registrerede artikler fordelt på udgivelser

...

...

...

...

...