Getting started with C and Embedded C programming: Study C in 7 days

1st day

Introduction to C Programming

C is a powerful and effective programming language. We can create System software, Embedded hardware and application software by programming with C. C is popularly termed as the successor of basic combined programming language known as B. The B language is implemented in 1960 at Cambridge University. Embedded C programming is an essential tool for any electronic engineers and developers.


Here i-St@r gives you the better opportunity to study C and Embedded C programming languages. We planned to cover C in 7 days. You can study C in one week, if you make use of this site effectively. After 7 days you may be able to develop basic application program and embedded program for microcontrollers (PIC).


Development of C language

The development of C language is directly related to the Unix operating system development. C was invented by Dennis Richey and Barian.W in 1972 at Bell laboratory. C language is compatible with Windows, Dose, Unix operating systems. The Unix operating system is mainly used for C language development. The coding done in Unix and the coding method of C is almost similar in structure. Unix operating system is also developed from Cambridge university.

Importance of C language

C programming language has accurate frame structure, so we can call it as a structural programming language. There are wide varieties of functions and operators are available in C, it is possible to develop complex programs, system software, embedded hardware and application software by manipulating these operators and functions. Group of programs that helps the working of a computer is known as system software for example Compiler, Interpreter, Operating system, etc. Application software is nothing but a group of programs that control a single application only for example MS Word, MS Power point, etc. C programming is a free language that is it can run in any computer as well. Also the portability feature makes C language more popular. The programs written in C language are very efficient and effective. For example to add 1 to 10 numbers using C language is take lower time as compared to that of written in Basic.

Method of Coding in C

In normal case we are using small letter English alphabets for program coding, but capital letters are can also be used. Capital letters are often used for defining some constants or variables. Another symbol for C language coding is ‘{}’ brackets. It is used to include the group of codes together while a program is executing. This helps the programmer to easily identify the faults and errors in the program. We can write the coding statements in any row, because C is an independent programming language. Consider an example, a=b+c;
d=e-f;
i=a*b;
Above statements can also be written in single line as,
a=b+c; d=e-f; i=a*b;
It is important to provide semicolon ‘;’ at the end of any statement.

Stages of a C program

Programming language is a medium for communication between a computer and user. Before studying C programming we must aware of the different Symbols, Words, Syntax, etc used in the C language. The following are the different stages in a C program.
  • Creating the program
  • Compiling the program
  • Linking the program
  • Execution of the program

Creating the program

A computer is ready to accept different programs after loading the operating system in to the memory of that computer. Now we are going to give program codes using input devices. These codes should be in the form of a File. A file name contains two parts, such as File name and Extension name. These two parts are separated by a period (.). In this the Extension name indicates the behavior of that file. For example a C program file consisting of a name followed by .C extension. That is istar.c (Red colour indicates the extension)

Compiling a program

After the development of a program we must convert it in to Machine level language from High level language. Because the computer knows machine level language only. The media for this conversion is called as Compiler. Compiler is simply a translating program it translate High level language to machine level language. The high level language program written by the programmer is called Source codes. These source codes are converted to machine level language using Compiler, and then it is known as Objective program. A compiler is capable of identifying the syntax errors in the program but it can’t identify the logical mistakes.

Linking the program

The process of connecting all the functions and other programs together for creating our program is called Linking. For example the object code of printf() function is stored in the library files of the system, so at the stage of Linking the object codes in library file is linked to the main funcuin.

Executing the program

The object code execution starts after the finishing of linking process. User gives the necessary inputs at this stage.
Ads

C Programs Beginner Guide

 

Copyright © 2011 CircuitsGallery| ToS | Privacy Policy | Sitemap

Contact Us | Write For Us | Advertise on Circuits Gallery | About Us