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

C All-in-One Desk Reference For Dummies

Dan Gookin

Compartir libro
  1. English
  2. ePUB (apto para móviles)
  3. Disponible en iOS y Android
eBook - ePub

C All-in-One Desk Reference For Dummies

Dan Gookin

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es C All-in-One Desk Reference For Dummies un PDF/ePUB en línea?
Sí, puedes acceder a C All-in-One Desk Reference For Dummies de Dan Gookin en formato PDF o ePUB, así como a otros libros populares de Informatik y Programmierung in C. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Editorial
For Dummies
Año
2011
ISBN
9781118054246
Edición
1
Categoría
Informatik

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...

Índice