What is C?

What is a programming language

Main index page

Top of page


A programming language is a way for humans to write instruction code for computers. Computer communicate in binary that is ones and zeros. An example would look like this...


01100010 10101110 11000110 11010110 00000100 10110010 10010110 11000110
01001110 11110110 11001110 00010110 10010110 00101110 10000100 10000100



This is very hard to read and under stand so we write code that looks more like human words and would look like this...






A compiler is used to change the readable code into binary for us.


The history of C

Main index page

Top of page


<To be completed at a later date>


Comparing C to other languages

Main index page

Top of page


It is important to point out that C is a programming language just like assembly and Pascal are. These are not scripting languages like Visual BASIC, Perl, HTML, Java. A programming language can generate a binary file that runs on a computer and does not need a scripting engine. Visual BASIC, Perl and Java all need a scripting engine to run and they remain in source code form. There are many versions of BASIC that do compile to a stand alone binary but not Visual BASIC and there are scripting engines to run C code like a script.


Like all programming languages there are advantages to using C and disadvantages.



Language

Reasons better then C

Reasons C is better


Scripters

- Final product will work on many different systems without recompiling
- Program is easy to share with others, the code is included.

- Final program runs faster and more efficiently
- Does not need a run time engine
- You can share the program without sharing the source


Pascal

- Easier to read language, good for beginners
- Build in string handling
- Supports properties*
- Supports exception handing

- More commonly used
- Supports multiple inheritance*
- Supports overloading*


BASIC

- Very easy to read, great for beginners

- Can evolve to an object language
- Code is more portable to other systems
- Stricter coding promotes consistent quality of code
- More control over low-level features
- More mature language with greater ability


Assembly

- Programs run faster and more efficiently
- Programs are smaller

- Code will port to other systems
- Code is readable
- Does not require in the programmer to have detailed knowledge of the CPU's inner workings
- Programming goes faster, large projects are easier.

* Refers to languages that are the object version like object Pascal or C++

File hierarchy

Main index page

Top of page


In C your source code files are divided in to two types header files and code files. The header files are like road maps of the code files. Code file are usually identified with a ".c" at the end of the file name, headers are usually found with ".h" at the end of the file name. When the compiler is building your program it will compile the code files in to object files it will then link all of the object files in to one file your program. When the compiler is compiling it will only compile one code file at a time, it will use the header file as the map of the code file. It will also use the other header files to know what the other code files will be providing it with. Many times when you are compiling you will use other header file to use the features provided by other object files that came with the compiler or are extra libraries. Some compilers have separate programs for linking the object files together, others use the same program but it will either know if it is compiling or linking or you can tell it. Compiling and linking can be done in one step with some compilers but it is a good idea to only compile each code file to an object and link after so that as your project gets larger you only need to compile the code files that change thus saving you time.