Sorted by:  

Declaring Variables in C

Variables are what make your programs zoom. Programming just can't get done without them. So if you haven't been introduced to variables yet, here you go. [more…]

Looking at the C Language

Each program must have a starting point. When you run a program, DOS sends it off on its way — like launching a ship. As its last dock-master duty, DOS hurls the microprocessor headlong into the program [more…]

Creating Source Code in C

When you create a program, you tell the computer what to do. Because the computer can't understand speech and because hitting it — no matter what emotional value that has for you — does little to the PC [more…]

Determining Types of Numbers in C

One of the frustrating aspects of the C programming language is the C Numeric Data Type Puzzle. Unlike in real life, where you can just pull any number out of the ethers and be joyously happy with it, [more…]

How to Construct a Basic IF Statement in C

To really use the power of the C language, your programs need to make decisions. A computer can't think, but it can make comparisons, evaluate the results of the comparisons, and then act on that information [more…]

How to Construct a Basic IF-ELSE Statement in C

More often than not, your C-language programs react to an if comparison in two ways. First, they execute statements when a condition is true, but what happens when the situation is false? For example, [more…]

Choosing from Multiple Options in the C Language with ELSE-IF

The C language gives you a number of ways to build a program that makes a decision. If you need something to happen only when a particular prerequisite is met, C offers you the [more…]

How to Construct a Basic FOR Loop in the C Language

The core of most modern programs, including those in the C language, is the loop. A loop gives a program the ability to repeat a group of statements, sometimes for a given count or duration, or, often, [more…]

Breaking Out of an Infinite Loop in Your C Language Program

When you get into programming loops in the C language, you discover the joys and dreads of endless, or infinite, loops. These loops continue forever because either the programmer forgot to include a way [more…]

Incrementing and Decrementing in the C Language

The C language is full of shortcuts, and they're wonderful things. First, they save you typing time. More importantly, the shortcuts let you express some ideas in quick yet fun and cryptic ways, which [more…]

Incrementing or Decrementing a Variable in C Before or After You Use It

The C language is full of shortcuts, and they're wonderful things. First, they save you typing time. More importantly, the shortcuts let you express some ideas in quick yet fun and cryptic ways, which [more…]

C Language Escape Sequences

When you're programming in the C language, sometimes you need to refer to a key press that doesn't result in a specific character. Other times, you need to refer to a specific character literally that [more…]

How to Use Conversion Characters in the C Language's printf() Function

In the C language, if you want to print the value of a variable to the screen, you'll likely use the printf() function. To do so, you need to include a conversion character — a placeholder of sorts — in [more…]

How to Declare and Use Constants in the C Language

Constants can be very useful in C programming whenever you have any value that is repeated in your program. Declaring a constant allows you to quickly and easily change a value that is used throughout [more…]

The Importance of the main() Function in C Programming

All C language programs must have a main() function. It's the core of every program. It's required. The main()function doesn't really have to do anything other than be present inside your C source code [more…]

A Closer Look at C Functions

Functions are small routines or software commands that do specific tasks. In the C language, most of the work is done by these functions, not by the C language keywords. Functions are the key to creating [more…]

How to Display Text On-Screen in C with puts() and printf()

The things that a C program can do are limitless, but when you're first learning the language, you need to start small. One of the most common functions you'll want your C program to do is display text [more…]

How to Insert Comments in C Source Code

Like other programming languages, C lets you insert comments in your code. The comments are skipped over by the compiler but remain in the source code as a way for you to jot down notes, your intentions [more…]

Watching Out for Nested Comments in C

Because C's comments start and end with specific characters, you cannot put one comment inside another. This is known as nesting. Nested comments can cause errors in your code, so while you're programming [more…]

The Real Difference between Integers and Floating-Point Values

If a floating-point value can also be a whole number, why bother using integers in your programs at all? The reason is that floating-point values and integers are handled differently inside the computer [more…]

Text Input/Output Functions in the C Language

When you start dealing with variables in C, you'll invariably stumble into the garden of I/O, or input/output. The computer's primary input device is the keyboard, and its primary output device is the [more…]

C Language Conversion Characters

When programming in C, you use conversion characters — the percent sign and a letter, for the most part — as placeholders for variables you want to display. The following table shows the conversion characters [more…]

C Language Escape Sequences

Programming in C is fast — all you have to do is type a short sequence of keystrokes — generally just two — to get a tab, a new line, a question mark, and more. The following table shows the sequences [more…]

C Language Keywords

The C programming language has just 32 keywords for you to build robust programs. With only 32 keywords, they all fit nicely into a short table. Use them wisely and well. [more…]

C Language Numeric Data Types

When programming with C, keywords and variables go together like the 4th of July and fireworks, although with a bit less drama. The following table shows C keywords, their variable types, and their ranges [more…]

Sign Up for RSS Feeds

Computers & Software

Inside Dummies.com