Modern C Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library
()
About this ebook
Discover how C's efficiency makes it a popular choice in a wide variety of applications and operating systems with special applicability to wearables, game programming, system level programming, embedded device/firmware programming and in Arduino and related electronics hobbies in this condensed code and syntax guide. This book presents the essential C syntax in a well-organized format that can be used as a quick and handy reference.
In this book, you will find short, simple, and focused code examples; and a well laid out table of contents and a comprehensive index allowing easy review. You won’t find any technical jargon, bloated samples, drawn out history lessons, or witty stories. What you will find is a language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any C programmer.What You Will Learn
- Code for some of today's modern and popular firmware and systems
- How to do embedded programming found in Arduino and related hardware boards
- Program microcontrollers for robots and boards
- Handle low-level programming and memory management
- Leverage operating systems such as Linux and Unix
Who This Book Is For
Those with experience in programming, particularly C programming, looking for a quick, handy reference.
Mikael Olsson
Mikael Olsson is a professional programmer, author and web entrepreneur. He enjoys teaching, writing books and making sites that summarize various fields of interest. The books he writes are focused on teaching their subject in the most efficient way possible, by explaining only what is relevant and practical without any unnecessary repetition or theory. He can be reached online at Siforia.com.
Read more from Mikael Olsson
Java 17 Quick Syntax Reference: A Pocket Guide to the Java SE Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsHandbook of Success: How to Make your Life What you Want it to Be Rating: 5 out of 5 stars5/5C++17 Quick Syntax Reference: A Pocket Guide to the Language, APIs and Library Rating: 0 out of 5 stars0 ratingsJava Quick Syntax Reference Rating: 0 out of 5 stars0 ratingsCSS3 Quick Syntax Reference: A Pocket Guide to the Cascading Style Sheets Language Rating: 0 out of 5 stars0 ratingsPHP 8 Quick Scripting Reference: A Pocket Guide to PHP Web Scripting Rating: 0 out of 5 stars0 ratingsC++20 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsC# 8 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsC# 7 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsCSS Quick Syntax Reference Rating: 0 out of 5 stars0 ratings
Related to Modern C Quick Syntax Reference
Related ebooks
C++20 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsC# 7 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsC# 8 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library Rating: 0 out of 5 stars0 ratingsC Programming Language Rating: 4 out of 5 stars4/5C Programming Language, A Step By Step Beginner's Guide To Learn C Programming In 7 Days. Rating: 4 out of 5 stars4/5C Programming For Beginners: The Simple Guide to Learning C Programming Language Fast! Rating: 5 out of 5 stars5/5Introducing Vala Programming: A Language and Techniques to Boost Productivity Rating: 0 out of 5 stars0 ratingsLearn C Programming in 24 Hours Rating: 0 out of 5 stars0 ratingsC Programming Wizardry: From Zero to Hero in 10 Days: Programming Prodigy: From Novice to Virtuoso in 10 Days Rating: 0 out of 5 stars0 ratingsC Programming: C Programming Language for beginners, teaching you how to learn to code in C fast! Rating: 0 out of 5 stars0 ratingsBeginning Linux Programming Rating: 0 out of 5 stars0 ratingsMastering C# - A Comprehensive Guide Rating: 0 out of 5 stars0 ratingsC# Deconstructed: Discover how C# works on the .NET Framework Rating: 0 out of 5 stars0 ratingsLearn C++ for Game Development Rating: 0 out of 5 stars0 ratingsVisual Studio Code Distilled: Evolved Code Editing for Windows, macOS, and Linux Rating: 3 out of 5 stars3/5Basics of Programming: A Comprehensive Guide for Beginners: Essential Coputer Skills, #1 Rating: 0 out of 5 stars0 ratingsC Clearly - Programming With C In Linux and On Raspberry Pi Rating: 0 out of 5 stars0 ratingsC Programming Language The Beginner’s Guide Rating: 0 out of 5 stars0 ratingsMastering C: A Comprehensive Guide to Programming Excellence Rating: 0 out of 5 stars0 ratings.NET Mastery: The .NET Interview Questions and Answers Rating: 0 out of 5 stars0 ratingsIntroduction to Programming Languages Rating: 4 out of 5 stars4/5Web Applications with Elm: Functional Programming for the Web Rating: 0 out of 5 stars0 ratingsLearn to Program with Kotlin: From the Basics to Projects with Text and Image Processing Rating: 0 out of 5 stars0 ratingsPHP 8 Quick Scripting Reference: A Pocket Guide to PHP Web Scripting Rating: 0 out of 5 stars0 ratingsF# for Scientists Rating: 5 out of 5 stars5/5Programming In ‘C’ Rating: 0 out of 5 stars0 ratingsPro C# 9 with .NET 5: Foundational Principles and Practices in Programming Rating: 0 out of 5 stars0 ratingsPro C# 8 with .NET Core 3: Foundational Principles and Practices in Programming Rating: 0 out of 5 stars0 ratingsBasic Guide to Programming Languages Python, JavaScript, and Ruby Rating: 0 out of 5 stars0 ratingsTCP/IP Sockets in C: Practical Guide for Programmers Rating: 4 out of 5 stars4/5
Programming For You
HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsLearn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5The Unofficial Guide to Open Broadcaster Software: OBS: The World's Most Popular Free Live-Streaming Application Rating: 0 out of 5 stars0 ratingsCoding All-in-One For Dummies Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Python Projects for Beginners: A Ten-Week Bootcamp Approach to Python Programming Rating: 0 out of 5 stars0 ratingsSQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5The Little SAS Book: A Primer, Sixth Edition Rating: 5 out of 5 stars5/5Teach Yourself C++ Rating: 4 out of 5 stars4/5Pokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Web Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5
Reviews for Modern C Quick Syntax Reference
0 ratings0 reviews
Book preview
Modern C Quick Syntax Reference - Mikael Olsson
© Mikael Olsson 2019
Mikael OlssonModern C Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4288-9_1
1. Hello World
Mikael Olsson¹
(1)
Hammarland, Länsi-Suomi, Finland
To begin programming in C, you need a text editor and a C compiler. You can get both at the same time by installing an Integrated Development Environment (IDE) that includes support for C. A good choice is Microsoft’s Visual Studio Community Edition, which is a free version of Visual Studio available from Microsoft’s website.¹ This IDE has built-in support for the C89 standard and includes most features up to C99 as of the 2017 version.
Some other popular cross-platform IDEs include Eclipse CDT, Visual Studio Code, Code::Blocks, and CodeLite. Alternatively, you can develop using a simple text editor—such as Notepad—although this is less convenient than using an IDE. If you choose to do so, just create an empty document with a .c file extension and open it in the editor of your choice. By convention, the .c extension is used for files that contain source code for C programs.
Creating a Project
After installing Visual Studio, with the C++ component selected during installation, go ahead and launch the program. You then need to create a project, which will manage the C source files and other resources. Go to File ➤ New ➤ Project to display the New Project window. From there, select the Visual C++ template type in the left frame. Then select the Empty Project template in the right frame. At the bottom of the window you can configure the name and location of the project. When you are finished, click the OK button and the wizard will create your empty project.
Adding a Source File
You have now created a C/C++ project. In the Solution Explorer panel (View ➤ Solution Explorer), you can see that the project consists of four empty folders: External Dependencies, Header Files, Resource Files, and Source Files. Right-click on the Source Files folder and select Add ➤ New Item. From the Add New Item dialog box, choose the C++ File (.cpp) template. Give this source file the name myapp.c. The .c file extension will make the file compile in C instead of C++. Click the Add button, and the empty C file will be added to your project and opened for you.
Hello World
The first thing to add to the source file is the main function. This is the entry point of the program, and the code inside of the curly brackets is what will be executed when the program runs. The brackets, along with their content, are collectively referred to as a code block, or just a block.
int main(void) {}
Your first application will simply output the text Hello World
to the screen. Before this can be done, the stdio.h header needs to be included. This header provides input and output functionality for the program, and is one of the standard libraries that comes with all C/C++ compilers. What the #include directive does is effectively replace the line with everything in the specified header before the file is