Learning c programming



Learning c programming 





Sample of the pdf document :








Introduction:

Programming languages are just tools that we use to tell the computer what we want it to do. Structure and form are the real knowledge and learning new languages is just adding new tools to the toolbox to handle specific jobs. That is what this tutorial is based on. We have to assume that the user of this tutorial already has an intermediate level of knowledge in C++ programming and techniques. Since C++ is built on C, the differences are easily assimilated to provide the programmer with a new set of tools to attack software solutions that require the tools that C provides.

Since C++ is built on C, many things are the same as C++. This tutorial will provides an overview to the differences between C and C++ and things the programmer needs to know to work with those differences. This is not meant to be comprehensive lessons on C programming so do not believe that it will answer all of the questions regarding programming in C.

Since programming in C is a useful skill for courses such as Operating Systems and Computer Networks, this tutorial is focused on providing the student with the tools needed to deal with the more advanced concepts that will be presented in those courses.


History:

“C is a general –purpose programming language that was originally designed by Dennis Ritchie of Bell Laboratories and implemented there on a PDP-11 in 1972.” (Kelley and Pohl 1) A language called B was being used as the system language for UNIX system programming and C was developed to overcome some of the limitations Ken Thompson found in using B as his system programming language.

C is a small language with few keywords and in programming, small is good. It is the native language of UNIX and a good portion of MS-DOS and OS/2 are written in C. C contains operators that allow the programmer to access the machine at the bit level, allowing for powerful programs. C is also the basis for Java as well as C++, which is why those languages are so similar.


Hello World:

Most teaching documents on programming start with the simple “Hello World” program. Why be different here except that we will show first the C++ version that you are familiar with and then the C version for contrast.
In C++ : #include <iostream> int main() { cout << “Hello World!\n”; return 0; }
In C:  #include <stdio.h> int main() { printf(“Hello World!\n”); return 0; }



Note that even though the keywords and libraries are different, there is little difference in the overall program structure. Now we will take a closer look at the differences........






 Click here for  Download PDF / FREE




0 commentaires: