Getting Started With C


BEING A HUMAN BEING THIS IS OUR DUTY TO HELP THE POOR PEOPLE. I REQUEST FROM ALL The people Please help and love with the poor people.If you help poor people than god help you.IT IS REALITY OF THE WORLD WHEN YOU HELP THE POOR ONE YOU FEEL VERY HAPPY. YOUR HURT BEGINS O FEEL RELAX.PLEASE PLEASE PLEASE HELPS THE POOR PEOPLE.THANKS.......



Image result for c languages perfect pictures










Overview

                      A computer is a device that follows the instructions given to it. A well-defined set of instructions given to the computer is called computer program. A computer program is written in a programming language.Since the emergence of computer, many programming languages have been developed but the effect of C on the computer world is everlasting. 

History of C

The C programming language was developed by Dennis Ritchie in 1972 at AT & T Bell Laboratories. It was derived from an earlier programming language named B. The B was developed by Ken Thompson in 1969-70 and provided the bases for the development of C. The C was originally designed to write system program under UNIX operating system. But over the year its power and flexibility have made it popular in industries for a vide range of applications.


Developing a C program (A Step Wise Approach)

Writing a program in C is not too difficult; however it requires a good understanding of the development environment of C language. The programmer should have the knowledge of steps required to prepare a C program for execution.

As a first step, install a compiler for the C language on the computer so that the source program can be compiled and executed. Many compilers for C language are available from number of vendors. Any of them can be used, but I recommended using Turbo C++.

Turbo C++ (A Compiler for the C Language)

Turbo C++ is a Borland International's implementation of a compiler for C language. In addition to a compiler, TC provides a complete IDE (Integrated Development Environment) to create, edit and save programs is called TC editor. It also provides a powerful debugger that helps in detecting and removing errors in the program.
            Once the TC (Turbo C) has been installed, it is very easy to write C programs in its editor. The IDE can be invoked by typing tc on the DOS prompt or by double clicking the TC shortcut. The menu bar of the IDE contains menus to create, edit, compile, execute (Run) and debug a C program. A menu can be opened by either clicking the mouse on it or pressing the first highlighted character of the name of the menu in conjunction with the Alt key. For example to open File menu, press Alt+F (hold down Alt key and then press F key).   

Creating and Editing a C Program:

To write the first C program, open the edit window of the Turbo C++ IDE. his can be done by selecting File?New option from the menu bar. A window appears on the screen. This window has a double-lined border, and a cursor inside the window represents the starting point to write a program.
We can expand this window by clicking the arrow in the upper right corner, or by selecting Window?Zoom from the menu bar. We can navigate through the program by using the vertical and horizontal scroll bars or by using arrow keys.

Saving a C program:

After writing the C program, we should save it on the disk. This can be done by selecting File/Save command from the menu bar or pressing the F2 key. When we select File/Save, a dialog box will appear. At top of this dialog box, there is a text box with caption Save File As. Type the name of the file in it and press the Enter key. The default path for saving the file is BIN folder. The TC assigns a default name NONAME00.cpp to file.

Compiling a C program:

The computer does not under stand source program because instructions in the program re meaningless to the microprocessor, as it understands only the machine language. A program tha is to be executed must be in the form of machine language.
                  C compiler translates the source program into an object program with .obj extension. To invoke Turbo C++ compiler, select Compile/Compile from the menu bar or press Alt+F9 Key. If there is no error in the source program, the program will be translated to object program successfully otherwise, the compiler will report errors in the program.

  • The program written in any high level programming language, such as C, is called source program.
  • The compiler produces an object program from the source program.

Linking a C Program

While writing a C program, the programmer may refer to many files to accomplish various tasks such as input/output etc. In case of C language, a lot of functionality is available in the form of library files. Rather than reinventing the wheel, most of the times we prefer to use the built-in-functionality of the language. Such files are needed to be linked with the object file, produced by the compiler, before execution of the program.
          Linking is the process in which the object file produced by the compiler is linked to many other library files by the linker.


















Comments

Post a Comment

Popular posts from this blog

Data Base Design Process

Data Base

Data Integrity And Normalization