C Programming For Dummies
eBook - ePub

C Programming For Dummies

Dan Gookin

Condividi libro
  1. English
  2. ePUB (disponibile sull'app)
  3. Disponibile su iOS e Android
eBook - ePub

C Programming For Dummies

Dan Gookin

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Get an A grade in C

As with any major language, mastery of C can take you to some very interesting new places. Almost 50 years after it first appeared, it's still the world's most popular programming language and is used as the basis of global industry's core systems, including operating systems, high-performance graphics applications, and microcontrollers. This means that fluent C users are in big demand at the sharp end in cutting-edge industries—such as gaming, app development, telecommunications, engineering, and even animation—to translate innovative ideas into a smoothly functioning reality.

To help you get to where you want to go with C, this 2nd edition of C Programming For Dummies covers everything you need to begin writing programs, guiding you logically through the development cycle: from initial design and testing to deployment and live iteration. By the end you'll be au fait with the do's and don'ts of good clean writing and easily able to produce the basic—and not-so-basic—building blocks of an elegant and efficient source code.

  • Write and compile source code
  • Link code to create the executable program
  • Debug and optimize your code
  • Avoid common mistakes

Whatever your destination: tech industry, start-up, or just developing for pleasure at home, this easy-to-follow, informative, and entertaining guide to the C programming language is the fastest and friendliest way to get there!

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
C Programming For Dummies è disponibile online in formato PDF/ePub?
Sì, puoi accedere a C Programming For Dummies di Dan Gookin in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming in C. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2020
ISBN
9781119740261
Edizione
2
Part 1

The ABs of C

IN THIS PART …
  • Get started with C coding
  • Work through your very first program
  • Learn how programming works
  • Discover the parts of the C language
  • Craft a basic C skeleton
Chapter 1

A Quick Start for the Impatient

IN THIS CHAPTER
check
Reviewing software requirements
check
Programming at the command prompt
check
Using an IDE
check
Creating a command prompt program
check
Working in Code::Blocks
check
Compiling a program
You’re most likely eager to get started programming in C. I shan’t waste your time.
Tip
If you already have a compiler or an IDE set up and are ready to go, skip to Chapter 2.

What You Need to Program

The two most important things you need to begin your programming adventure are
  • A computer
  • Access to the Internet
The computer is your primary tool for writing and compiling code. Yes, even if you’re writing a game for the Xbox, you need a computer to be able to code. The computer can be a PC or a Macintosh. The PC can run Windows or Linux.
Internet access is necessary to obtain the programming software. You need a text editor to write the code and a compiler to translate the code into a program. The compiler generally comes with other tools you need, such as a linker and a debugger. All these tools are found at no cost on the Internet.
The software tools offer two approaches to programming: command line and IDE.
If you want to learn C programming as I did back in the dark ages, you use a terminal window and traditional command-line tools: editor, compiler, and linker. The process is fast, but complicated because you’re using text mode commands. Still, it offers a spiritual connection with those who built the foundations upon which the computer industry roosts.
The most common way to craft code, however, is to obtain an integrated development environment — called an IDE by the cool kids. It combines all the tools you need for programming into one compact, terrifying, and intimidating unit.
Don’t freak! The terms compiler, linker, debugger, and terrifying are all defined in Chapter 2.

Command Prompt Programming

To re-create the environment where the C language was born, use a Unix or Linux terminal window running a shell program such as bash. This environment is available to all major computing platforms, and the programming tools used are reliable and well-documented. Programming at the command prompt earns you a nerd merit badge and the admiration of your peers.
For Windows 10, open the Microsoft Store app and install Ubuntu, a free Linux shell. Ensure that you follow the directions to install the Windows Subsystem for Linux, which is an extra step you’ll probably miss.
For Linux, you’re ready to go: Open a terminal window to access the shell.
For Mac OS X, use the Terminal app. I also recommend obtaining the Homebrew package manager. Visit https://brew.sh for directions. Homebrew allows you to install programming tools not available to OS X.
For an editor, you can use any text mode editor available at the command prompt, such as vi or emacs. You can also “mix it up” and use a window-based editor. I’m fond of using the Windows version of the VIM editor while I simultaneously work at the command prompt in an Ubuntu terminal window.
A C compiler comes native to a Unix/Linux command prompt. The standard version is cc or gcc, but I recommend that you use the shell’s package manager to acquire the LLVM clang compiler. In Ubuntu Linux for Windows 10, type this command to install clang:
sudo apt-get install clang
Type your account password to initiate the process. To verify the installation, type
clang --version
Various Linux distros offer similar package managers, which you can use to obtain an editor and the clang compiler.
  • The VIM editor can be obtained from vim.org.
  • Remember
    Your choice to use the command prompt means you’re taking on an extra layer of complexity when it comes to programming. I find it fast and enjoyable, but if you believe it to be too much, especially when first learning the C language, rely instead upon an IDE, as covered in the next section.

IDE Programming

Plenty of programming IDEs are available for your C coding pleasure. On the Mac, use Xcode, which you can install from the App Store. For Windows and Linux, I recommend obtaining the Code::Blocks IDE, which is found at codeblocks.org. You can choose any other IDE you prefer, but Code::Blocks for Windows is fairly stable and comes with everything you need — providing that you install the correct version.

Installing Code::Blocks

The Code::Blocks website will doubtless b...

Indice dei contenuti