O'Reilly logo

Learn C on the Mac: For OS X and iOS, Second Edition by James Bucanek, David Mark Scott Brown

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    3

C Basics: Statements and Functions

Every programming language is designed to follow strict rules that define the language’s source code structure. The C programming language is no different. These next few chapters will explore the syntax of C. This chapter focuses on two of the primary building blocks of C programming: statements and functions. In a nutshell, a statement tells the computer to do something. A function is a series of statements.

C Statements

A statement in C is very much like a declarative statement in English; it tells the computer to do something. “Say ‘Hello’” and “preheat oven to 350°F” are examples of concise, unambiguous, English statements. Here are two statements in the C language:

printf( "Hello!\n" ); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required