C Tips from the New School
Throw out your old ideas about C and get to know a programming language that’s substantially outgrown its origins. With this revised edition of 21st Century C, you’ll discover up-to-date techniques missing from other C tutorials, whether you’re new to the language or just getting reacquainted.
C isn’t just the foundation of modern programming languages; it is a modern language, ideal for writing efficient, state-of-the-art applications. Get past idioms that made sense on mainframes and learn the tools you need to work with this evolved and aggressively simple language. No matter what programming language you currently favor, you’ll quickly see that 21st century C rocks.
- Set up a C programming environment with shell facilities, makefiles, text editors, debuggers, and memory checkers
- Use Autotools, C’s de facto cross-platform package manager
- Learn about the problematic C concepts too useful to discard
- Solve C’s string-building problems with C-standard functions
- Use modern syntactic features for functions that take structured inputs
- Build high-level, object-based libraries and programs
- Perform advanced math, talk to internet servers, and run databases with existing C libraries
This edition also includes new material on concurrent threads, virtual tables, C99 numeric types, and other features.
About the Author
Ben Klemens has been doing statistical analysis and computationally-intensive modeling of populations ever since getting his PhD in Social Sciences from Caltech. He is of the opinion that writing code should be fun, and has had a grand time writing analyses and models (mostly in C) for the Brookings Institution, the World Bank, National Institute of Mental Health, et al. As a Nonresident Fellow at Brookings and with the Free Software Foundation, he has done work on ensuring that creative authors retain the right to use the software they write. He currently works for the United States FederalGovernment.
The animal on the cover of 21st Century C is the common spotted cuscus (Spilocuscusmaculatus), a marsupial that lives in the rainforests and mangroves of Australia, NewGuinea, and nearby smaller islands. It has a round head, small hidden ears, thick fur,and a prehensile tail to aid in climbing. The curled tail is a distinctive characteristic;the upper part of the tail closest to the body is covered in fur, while the lower half iscovered in rough scales on the inside surface to grip branches. Its eyes range in colorfrom yellows and oranges to reds, and are slit much like a snake’s.
The common spotted cuscus is typically very shy, so it is rarely seen by humans. It isnocturnal, hunting and feeding at night and sleeping during the day on self-madeplatforms in tree branches. It is slow moving and somewhat sluggish—sometimesmistaken for sloths, other possums, or even monkeys.
Cuscuses are typically solitary creatures, feeding and nesting alone. Interactions withothers, especially between competing males, can be aggressive and confrontational.Male cuscuses scent-mark their territory to warn off other males, emitting a penetratingmusk odor both from their bodies and scent gland excretions. They distribute salivaon branches and twigs of trees to inform others of their territory and mediatesocial interactions. If they encounter another male in their area, they make barking,snarling, and hissing noises, and stand upright to defend their territory.
The common spotted cuscus has an unspecialized dentition, allowing it to eat a widevariety of plant products. It is also known to eat flowers, small animals, and occasionallyeggs. Predators of the common spotted cuscus include pythons and some birds ofprey.