C All-in-One Desk Reference For Dummies
eBook - ePub

C All-in-One Desk Reference For Dummies

Dan Gookin

Buch teilen
  1. English
  2. ePUB (handyfreundlich)
  3. Über iOS und Android verfĂŒgbar
eBook - ePub

C All-in-One Desk Reference For Dummies

Dan Gookin

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Ready, set, code! A user-friendly guide introducing the C programming language to new and intermediate coders

The C programming language and its direct descendants are widespread and among the most popular programming languages used in the world today. The enduring popularity of C continues because C programs are fast, concise, and run on many different systems. Flexible and efficient, C is designed for a wide variety of programming tasks: system-level code, text processing, graphics, telecommunications, and many other application areas. C All-in-One Desk Reference For Dummies is for beginning and intermediate C programmers and provides a solid overview of the C programming language, from the basics to advanced concepts, with several exercises that give you real-world practice.

C All-in-One Desk Reference For Dummies covers everything users need to get up to speed on C programming, including advanced topics to take their programming skill to the next level. Inside you'll learn

  • The entire development cycle of a C program: designing and developing the program, writing source code, compiling the code, linking the code to create the executable programs, debugging, and deployment
  • The intricacies of writing the code -- the basic and not-so-basic building blocks that make up the source code
  • Thorough coverage of keywords, program flow, conditional statements, constants and variables, numeric values, arrays, strings, functions, pointers, debugging, prototyping, and more
  • Dozens of sample programs you can adapt and modify for your own use

Written in plain English, this friendly guide also addresses some advanced programming topics, such as

  • Programming for the Linux/Unix console
  • Windows and Linux programming
  • Graphics programming
  • Games programming
  • Internet and network programming
  • Hardware programming projects

The book includes a handy appendix that shows you how to set up your computer for programming, how to select and use a text editor, and fix up the compiler, to ensure you're ready to work the author's examples. Written by Dan Gookin, the author of the first-ever For Dummies book (and several others) who's known for presenting complex material in an easy-to-understand way, this comprehensive guide makes learning the C programming language simple and fun. Grab your copy of C All-in-One Desk Reference For Dummies, so you can start coding your own programs.

HĂ€ufig gestellte Fragen

Wie kann ich mein Abo kĂŒndigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kĂŒndigen“ – ganz einfach. Nachdem du gekĂŒndigt hast, bleibt deine Mitgliedschaft fĂŒr den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich BĂŒcher herunterladen?
Derzeit stehen all unsere auf MobilgerĂ€te reagierenden ePub-BĂŒcher zum Download ĂŒber die App zur VerfĂŒgung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die ĂŒbrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den AboplÀnen?
Mit beiden AboplÀnen erhÀltst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst fĂŒr LehrbĂŒcher, bei dem du fĂŒr weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhĂ€ltst. Mit ĂŒber 1 Million BĂŒchern zu ĂŒber 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
UnterstĂŒtzt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nÀchsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist C All-in-One Desk Reference For Dummies als Online-PDF/ePub verfĂŒgbar?
Ja, du hast Zugang zu C All-in-One Desk Reference For Dummies von Dan Gookin im PDF- und/oder ePub-Format sowie zu anderen beliebten BĂŒchern aus Informatik & Programmierung in C. Aus unserem Katalog stehen dir ĂŒber 1 Million BĂŒcher zur VerfĂŒgung.

Information

Jahr
2011
ISBN
9781118054246

Chapter 1: Your Basic C Program

In This Chapter

bullet
Finding out some C language history
bullet
Building a C program one piece at a time
bullet
Understanding the C program skeleton
L earning a programming language is like trying to eat an entire banquet in one bite: You have so much to swallow at once, even to understand the most basic stuff, that it isn’t a question of where to start, but rather what not to eat so that you don’t get too sick too quickly.
This chapter provides a quick and dirty introduction to a single C language program. The chapter doesn’t even explain why things are necessary because, honestly, at this point in the game you’re probably more interested in accomplishing something than truly figuring out why something works. Don’t worry: That comes later. For now, this chapter offers a small taste of the feast to come.
Remember
Remember to use the basic folder or directory for the source code and program files in this book.

The Section Where the Author Cannot Resist Describing the History of C

In the beginning was Charles Babbage and his Analytical Engine, a machine he built in 1822 that could be programmed to carry out different computations. Move forward more than 100 years, where the U.S. government in 1942 used concepts from Babbage’s engine to create the ENIAC, the first modern computer.
To program Babbage’s computer, you had to literally replace stacks of gears. To make the ENIAC carry out different tasks, it had to be rewired by hand.
By the early 1950s, computer programming had evolved from rewiring to entering instructions using rows of switches. The process began with Professor John von Neumann, who in 1945 developed the concept of the function (or subroutine), the IF-THEN choice statement, and the repeating FOR loop. By 1949, Von Neumann had come up with a binary programming language he called Short Code. Then, in 1951, Grace Hopper developed the first compiler, which allowed the computer to be programmed using words and symbols rather than binary ones and zeroes. Computers could then be programmed with written instructions rather than by rewiring or throwing switches.
In the mid-1950s, the first major programming language appeared. Named FORTRAN, for formula translating system, it incorporated variables and introduced logical conditions to the art of programming. Then, in 1959, the COBOL programming language was developed as businesses began to adopt computers. COBOL was the first programming language with a truly English-like grammar.
The Algol language was developed at about the same time as COBOL. From Algol, many programming techniques were introduced that are still used today.
In 1968, Zurich professor Niklaus Wirth used Algol as a basis for the Pascal programming language. Pascal was designed as a teaching tool because it didn’t allow for sloppy programming and forced users to follow the rules of structured programming.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working with two languages: B (for Bell) and BCPL (Basic Combined Programming Language). Inspired by Pascal, Mr. Ritchie developed the C programming language.
The C language was used to write the Unix operating system. Ever since that first version of Unix in the early 1970s, a C compiler has always been a part of the operating system — even with Unix variations like Linux and Mac OS. It also explains why Unix comes with so many programming utilities. (Indeed, Unix is often called the “programmer’s operating system.”)
In 1983, C programmer Bjarne Stoustroup developed object oriented programming (OOP) extensions to the C language and created the C++ programming language. Even though it’s often taught as a separate subject, C++ is really about 95 percent original C. Even so, some purists stick with the original C language and don’t bother to discover that extra 5 percent of C++ — despite the power and flexibility it offers.
Branching off from C in the 1990s was another programming language: Java, from Sun Microsystems. Originally developed for interactive TV, the Java language truly found a home on the Web in 1994 and has been a popular Web programming language ever since.

Time to Program!

The C language has a certain structure to it — a form, a visual look, a feeling. Unlike in more freeform languages, you must obey traditions and rules to put together the most basic of C programs. That’s what gives the C language its look and feel.
The following sections introduce you to the basic structure of a simple C program — the skeleton. Each section builds on the next, so read them in order.
Ensure that you have read through Appendix A, which discusses how to set up the C language compiler on your computer and the basic steps for editing, compiling, and running a program.
One suggestion: Please save all the source code files for this book in the basic folder on your hard drive (prog/c/basic).

The basic, simplest C program

When you program a computer, you tell it exactly what to do. The instructions are given in a particular language — in this case, the C language. Those instructions are then compiled into object code. The object code is then linked with a C language library, and the result is an executable file or a program you can run on your computer. It’s just like magic!
I save the boring specifics for the next chapter. For now, consider the most basic of all programs:
Yes, that’s a blan...

Inhaltsverzeichnis