The Basics of C Programming

Categories:

Recommended

The C programming language is a popular and widely used programming language for creating computer programs. Programmers embrace C because it gives maximum control and efficiency to the programmer.

If you are a programmer, or if you are interested in becoming a programmer, there are a couple of benefits you gain from learning C:

• You will be able to read and write code for a large number of platforms – everything from microcontrollers to the most advanced scientific systems can be written in C.

• Because of the performance and portability of C, almost all popular crossplatform programming languages and scripting languages, such as C++, Java, Python, Objective-C, Perl, Ruby, PHP, Lua, and Bash, are implemented in C and borrowed syntaxes and functions heavily from C. They share the similar operators, expressions, repetition statements, control structures, arrays, input and output, and functions. Furthermore, almost all languages can interface with C and C++ to take advantage of a large volume of existing C/C++ libraries.

In this article, we will walk through the entire language and show you how to become a C programmer, starting at the beginning.

What is C?

C is a computer programming language. That means that you can use C to create lists of instructions for a computer to follow. C is one of thousands of programming languages currently in use. C has been around for several decades and has won widespread acceptance because it gives programmers maximum control and efficiency. C is an easy language to learn. It is a bit more cryptic in its style than some other languages, but you get beyond that fairly quickly.

C is what is called a compiled language. This means that once you write your C program, you must run it through a C compiler to turn your program into an executable that the computer can run (execute). The C program is the human-readable form, while the executable that comes out of the compiler is the machine-readable and executable form. What this means is that to write and run a C program, you must have access to a C compiler.

We will start at the beginning with an extremely simple C program and build up from there. I will assume that you are using the Linux command line and gcc as your environment for these examples; if you are not, all of the code will still work fine – you will simply need to understand and use whatever compiler you have available.

Category:

Attribution

Marshall Brain. The Basics of C Programming. https://www.phys.uconn.edu/~rozman/Courses/P2200_13F/downloads/TheBasicsofCProgramming-draft-20131030.pdf

VP Flipbook Maker

Make stunning flipbooks online. Create flipbooks for free with Visual Paradigm. Create online flipbooks, design, publish and share your flipbooks online, try it now!