1.0 About this tutorial

This is a course to teach you the basic syntax and logic used to program in the C programming language. We will focus of just the basics, nothing extremely advanced, just enough to give you a solid understanding of using the language. The tutorials will use examples to explain topics and there will be a short quiz at the end of selected chapters to reinforce main ideas and important information. The course expects you to learn small sections at a time and slowly peice the whole language together. We will assign programs for you to do from time to time to help you get down to actually writing programs on your own, this is the best way to learn any programming language. If you have access to the cluster you can write and compile your programs from there, there is no need to get out and buy software.

1.1.0 Brief History of C

C has evolved from several languages over the years to become one of the most popular programming languages today. It all started back in 1967 when Martin Richards created the language called BCPL. BCPL was a language popular for writing operating systems and compilers. It wasn't until 3 years later, 1970, that Ken Thompson of Bell Labs would take the BCPL language and modify it for special use. He took many of the instructions in BCPL out and created a language he dubbed as B. B was later used to make one of the first implementations of the UNIX operating systems. Two years later another employee at Bell Labs put some of the BCPL instructions back into the B language, this man was Dennis Ritchie and in 1972 we finally see the first version of the C language. For several years there wasn't a standard version of C, people would make specialized versions with custom compilers. It wasn't until around 1983 that an ANSI committee was formed to create a standard, formalized version of the language that would be supported by most compilers.

1.2.0 Why learn C?

When you are a beginning programmer it be very confusing to choose a first language to learn. Some people tend to think that C should not be taught to the beginner, many think the language has a harder syntax than other languages such as Pascal, or Visual Basic. But this is just not true, a person with no programming experience will have to study visual basic just as much as they would have to study C. One of the many reasons to learn C is that the language was designed for the programmer to add on to the language by programming custom libraries, which can be distributed to other people. This allows people to write efficient ways of doing things one time and then the library can be used in several other programs. This gives us endless flexibility with the language because we can also have more that one way to do something and can work to find the best solution for us.

C is also widely used on several different operating systems and code written under one operating system can usually be ported to another operating system with very little or no modification to the original code. This is very nice to have if you are using more that one operating system in a work environment.

You have probably heard of the portability of java between operating systems. Yes, Java can be ported to other operating systems with NO modifications to the source code but there is one advantage that you will lose in this, speed. With C you can write programs that run much faster than most high-level languages. This is mainly due to the fact that C lets you handle memory how memory is used. It may be harder to learn memory management in C than in Java, but you can greatly see the speed difference.

But mainly the best reason to learn C is that it is one of the most widely used languages in the industry. With the knowledge of the language you will be much more qualified in your field of work. Plus, once you learn one language a person can usually learn another one in a short amount of time. Since many other languages a very similar to the way C is structured, C is a great language for the beginning programmer to learn.

1.3.0 Setting up / What you will need

To get started with C you will need to have a compiler and a linker. A compiler is a program that converts your source code into machine code, readable by the computer. A linker is a program that takes the machine code generated by the compiler and creates a binary file that can be run. This binary file is you program in its finished form.

Depending on that operating system you have will mainly determine what compiler you will be using.