Tiny C Projects
Learn the big skills of C programming by creating bite-size projects! Work your way through these 15 fun and interesting tiny challenges to master essential C techniques you’ll use in full-size applications.

In Tiny C Projects you will learn how to:

Create libraries of functions for handy use and re-use
Process input through an I/O filter to generate customized output
Use recursion to explore a directory tree and find duplicate files
Develop AI for playing simple games
Explore programming capabilities beyond the standard C library functions
Evaluate and grow the potential of your programs
Improve code to better serve users

Tiny C Projects is an engaging collection of 15 small programming challenges! This fun read develops your C abilities with lighthearted games like tic-tac-toe, utilities like a useful calendar, and thought-provoking exercises like encoding and cyphers. Jokes and lighthearted humor make even complex ideas fun to learn. Each project is small enough to complete in a weekend, and encourages you to evolve your code, add new functions, and explore the full capabilities of C.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
The best way to gain programming skills is through hands-on projects—this book offers 15 of them. C is required knowledge for systems engineers, game developers, and roboticists, and you can start writing your own C programs today. Carefully selected projects cover all the core coding skills, including storing and modifying text, reading and writing files, searching your computer’s directory system, and much more.

About the book
Tiny C Projects teaches C gradually, from project to project. Covering a variety of interesting cases, from timesaving tools, simple games, directory utilities, and more, each program you write starts out simple and gets more interesting as you add features. Watch your tiny projects grow into real applications and improve your C skills, step by step.

What's inside

Caesar cipher solver: Use an I/O filter to generate customized output
Duplicate file finder: Use recursion to explore a directory tree
Daily greetings: Writing the moon phase algorithm
Lotto pics: Working with random numbers

And 11 more fun projects!

About the reader
For C programmers of all skill levels.

About the author
Dan Gookin has over 30 years of experience writing about complex topics. His most famous work is DOS For Dummies, which established the entire For Dummies brand.

Table of Contents
1 Configuration and setup
2 Daily greetings
3 NATO output
4 Caesarean cipher
5 Encoding and decoding
6 Password generators
7 String utilities
8 Unicode and wide characters
9 Hex dumper
10 Directory tree
11 File finder
12 Holiday detector
13 Calendar
14 Lotto picks
15 Tic-tac-toe
1140862205
Tiny C Projects
Learn the big skills of C programming by creating bite-size projects! Work your way through these 15 fun and interesting tiny challenges to master essential C techniques you’ll use in full-size applications.

In Tiny C Projects you will learn how to:

Create libraries of functions for handy use and re-use
Process input through an I/O filter to generate customized output
Use recursion to explore a directory tree and find duplicate files
Develop AI for playing simple games
Explore programming capabilities beyond the standard C library functions
Evaluate and grow the potential of your programs
Improve code to better serve users

Tiny C Projects is an engaging collection of 15 small programming challenges! This fun read develops your C abilities with lighthearted games like tic-tac-toe, utilities like a useful calendar, and thought-provoking exercises like encoding and cyphers. Jokes and lighthearted humor make even complex ideas fun to learn. Each project is small enough to complete in a weekend, and encourages you to evolve your code, add new functions, and explore the full capabilities of C.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
The best way to gain programming skills is through hands-on projects—this book offers 15 of them. C is required knowledge for systems engineers, game developers, and roboticists, and you can start writing your own C programs today. Carefully selected projects cover all the core coding skills, including storing and modifying text, reading and writing files, searching your computer’s directory system, and much more.

About the book
Tiny C Projects teaches C gradually, from project to project. Covering a variety of interesting cases, from timesaving tools, simple games, directory utilities, and more, each program you write starts out simple and gets more interesting as you add features. Watch your tiny projects grow into real applications and improve your C skills, step by step.

What's inside

Caesar cipher solver: Use an I/O filter to generate customized output
Duplicate file finder: Use recursion to explore a directory tree
Daily greetings: Writing the moon phase algorithm
Lotto pics: Working with random numbers

And 11 more fun projects!

About the reader
For C programmers of all skill levels.

About the author
Dan Gookin has over 30 years of experience writing about complex topics. His most famous work is DOS For Dummies, which established the entire For Dummies brand.

Table of Contents
1 Configuration and setup
2 Daily greetings
3 NATO output
4 Caesarean cipher
5 Encoding and decoding
6 Password generators
7 String utilities
8 Unicode and wide characters
9 Hex dumper
10 Directory tree
11 File finder
12 Holiday detector
13 Calendar
14 Lotto picks
15 Tic-tac-toe
59.99 In Stock
Tiny C Projects

Tiny C Projects

by Dan Gookin
Tiny C Projects

Tiny C Projects

by Dan Gookin

Paperback

$59.99 
  • SHIP THIS ITEM
    In stock. Ships in 1-2 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

Learn the big skills of C programming by creating bite-size projects! Work your way through these 15 fun and interesting tiny challenges to master essential C techniques you’ll use in full-size applications.

In Tiny C Projects you will learn how to:

Create libraries of functions for handy use and re-use
Process input through an I/O filter to generate customized output
Use recursion to explore a directory tree and find duplicate files
Develop AI for playing simple games
Explore programming capabilities beyond the standard C library functions
Evaluate and grow the potential of your programs
Improve code to better serve users

Tiny C Projects is an engaging collection of 15 small programming challenges! This fun read develops your C abilities with lighthearted games like tic-tac-toe, utilities like a useful calendar, and thought-provoking exercises like encoding and cyphers. Jokes and lighthearted humor make even complex ideas fun to learn. Each project is small enough to complete in a weekend, and encourages you to evolve your code, add new functions, and explore the full capabilities of C.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
The best way to gain programming skills is through hands-on projects—this book offers 15 of them. C is required knowledge for systems engineers, game developers, and roboticists, and you can start writing your own C programs today. Carefully selected projects cover all the core coding skills, including storing and modifying text, reading and writing files, searching your computer’s directory system, and much more.

About the book
Tiny C Projects teaches C gradually, from project to project. Covering a variety of interesting cases, from timesaving tools, simple games, directory utilities, and more, each program you write starts out simple and gets more interesting as you add features. Watch your tiny projects grow into real applications and improve your C skills, step by step.

What's inside

Caesar cipher solver: Use an I/O filter to generate customized output
Duplicate file finder: Use recursion to explore a directory tree
Daily greetings: Writing the moon phase algorithm
Lotto pics: Working with random numbers

And 11 more fun projects!

About the reader
For C programmers of all skill levels.

About the author
Dan Gookin has over 30 years of experience writing about complex topics. His most famous work is DOS For Dummies, which established the entire For Dummies brand.

Table of Contents
1 Configuration and setup
2 Daily greetings
3 NATO output
4 Caesarean cipher
5 Encoding and decoding
6 Password generators
7 String utilities
8 Unicode and wide characters
9 Hex dumper
10 Directory tree
11 File finder
12 Holiday detector
13 Calendar
14 Lotto picks
15 Tic-tac-toe

Product Details

ISBN-13: 9781633439825
Publisher: Manning
Publication date: 12/27/2022
Pages: 384
Product dimensions: 7.38(w) x 9.25(h) x 0.80(d)

About the Author

Dan Gookin is an author with over 30 years experience explaining complex topics in an informative and entertaining manner. His most famous work is DOS For Dummies, which established the entire For Dummies brand. In addition to writing books, Dan delivers online training for LinkedIn Learning, has his own informative YouTube channel, and serves on the city council in Coeur d’Alene Idaho.

Table of Contents

Preface xiii

Acknowledgments xv

About this book xvi

About the author xix

About the cover illustration xx

1 Configuration and setup 1

1.1 The C development cycle 2

Editing source code 2

Compiling, linking, building 3

1.2 The integrated development environment (IDE) 4

Choosing an IDE 4

Using Code::Blocks 5

Using XCode 7

1.3 Command-line compiling 9

Accessing the terminal window 9

Reviewing basic shell commands 10

Exploring text screen editors 11

Using a GUI editor 12

Compiling and running 12

1.4 Libraries and compiler options 13

Linking libraries and setting other options in an IDE 14

Using command-line compiler options 15

1.5 Quiz 16

2 Daily greetings 17

2.1 The shell starts 18

Understanding how the shell fits in 18

Exploring various shell startup scripts 18

Editing the shell startup script 20

2.2 A simple greeting 21

Coding a greeting 21

Adding a name as an argument 22

2.3 The time of day 23

Obtaining the current time 23

Mixing in the general time of day 25

Adding specific time, info 26

2.4 The current moon phase 27

Observing moon phases 28

Writing the moon phase algorithm 29

Adding the moon phase to your greeting 30

2.5 A pithy saying 31

Creating a pithy phrase repository 31

Randomly reading a pithy phrase 32

Adding the phrase to your greeting code 37

3 NATO output 38

3.1 The NATO alphabet 38

3.2 The NATO translator program 40

Writing the NATO translator 41

Reading and converting a file 42

3.3 From NATO to English 43

Converting NATO input to character output 44

Reading NATO input from a file 47

4 Caesarean cipher 50

4.1 I/O filters 51

Understanding stream I/O 51

Writing a simple filter 54

Working a filter at the command prompt 56

4.2 On the front lines with Caesar 57

Rotating 13 Characters 58

Devising a more Caesarean cipher 60

4.3 Deep into filter madness 63

Building the hex output filter 63

Creating a NATO filter 64

Filtering words 65

5 Encoding and decoding 68

5.1 The concept of plain text 69

Understanding ASCII 69

Exploring the control codes 71

Generating noncharacter output 74

Playing with ASCII co-aversion tricks 76

5.2 The hex encoder/decoder 79

Writing a simple hex encoder/decoder 79

Coding a better hex encoder/decoder 82

Adding a wee bit of error-checking 87

5.3 URL encoding 89

Knowing all the URL encoding rules 89

Writing a URL encoder 90

Creating a URL decoder 91

6 Password generators 93

6.1 Password strategies 94

Avoiding basic and useless passwords 94

Adding password complexity 95

Applying the word strategy 96

6.2 The complex password jumble 97

Building a silly random password program 97

Adding conditions to the password program 98

Improving upon the password 99

6.3 Words in passwords 101

Generating random words, Mad Libs style 101

Building a random word password generator 106

7 String utilities 109

7.1 Strings in C 110

Understanding the string 110

Measuring a string 112

Reviewing C string functions 114

Returning versus modifying directly 115

7.2 String functions galore 116

Changing case 117

Reversing a string 118

Trimming a string 121

Splitting a string 124

Inserting one string into another 125

Counting words in a string 128

Converting tabs to spaces 130

7.3 A string library 132

Writing the library source and header file 133

Creating a library 134

Using the string library 135

7.4 A kinda OOP approach 136

Adding a function to a structure 137

Creating a string "object" 139

8 Unicode and wide characters 141

8.1 Text representation in computers 142

Reviewing early text formats 142

Evolving into ASCII text and code pages 145

Diving into Unicode 147

8.2 Wide character programming 148

Setting the locale 149

Exploring character types 150

Generating wide character output 152

Receiving wide character input 156

Working with wide characters in files 160

9 Hex dumper 164

9.1 Bytes and data 164

Reviewing storage units and size mayhem 165

Outputting byte values 169

Dumping data 170

9.2 Dump that file! 175

Reading file data 175

Fixing uneven output 178

9.3 Command-line options 179

Using the getopt() function 180

Updating the dumpfile program code 182

Setting abbreviated output 185

Activating octal output 187

10 Directory tree 191

10.1 The filesystem 192

10.2 File and directory details 194

Gathering file info 194

Exploring file type and permissions 197

Reading a directory 203

10.3 Subdirectory exploration 207

Using directory exploration tools 208

Diving into a subdirectory 210

Mining deeper with recursion 212

10.4 A directory tree 217

Pulling out the directory name 218

Monitoring directory depth 220

11 File finder 223

11.1 The great file hunt 224

11.2 A file finder 225

Coding the Find File utility 225

Understanding the glob 228

Using wildcards to find files 232

11.3 The duplicate file finder 234

Building a file list 235

Locating Ike duplicates 239

12 Holiday detector 245

12.1 The operating system wants its vig 246

Understanding exit status versus the termination status 246

Setting a return value 246

Interpreting the return value 247

Using the preset return values 249

12.2 All about today 250

Getting today's date 250

Obtaining any old date 251

12.3 Happy holidays 254

Reviewing holidays in the United States 254

Discovering holidays in the UK 255

12.4 Is today a holiday? 256

Reporting regular date holidays 256

Dealing with irregular holidays 261

Calculating Easter 266

Running the date gauntlet 270

13 Calendar 273

13.1 The calendar program 274

13.2 Good dates to know 275

Creating constants and enumerating dates 276

Finding the day of the week 277

Calculating the first day of the month 280

Identifying leap years 282

Getting the time zone correct 283

13.3 Calendar utilities 285

Generating a week 286

Showing a month 292

Displaying a full year 295

Putting the full year into a grid 299

13.4 A calendar in color 303

Understanding terminal colors 303

Generating a tight-but-colorful calendar 306

Coloring holidays 309

14 Lotto picks 312

14.1 A tax for those who are bad at math 313

Playing the lottery 313

Understanding the odds 313

Programming the odds 315

14.2 Here are your winning numbers 317

Generating random values 317

Drawing lotto balls 320

Avoiding repeated numbers, another approach 322

14.3 Never tell me the odds 324

Creating the lotto() function 325

Matching lottery picks 327

Testing the odds 328

15 Tic-tac-toe 331

15.1 A silly kids' game 331

Playing tic-tac-toe 332

Approaching the game mathematically 333

15.2 The basic game 334

Creating the game grid 334

Adding game play 337

Limiting the input to free squares 339

Determining the winner 340

15.3 The computer plays 344

Choosing the number of players 344

Coding a dumb opponent 346

Adding some intelligence 348

Index 353

From the B&N Reads Blog

Customer Reviews