Environment For C | Program Development Steps
Environment for C
Some steps are involved in developing a c program which are as followed -
1. Program Creation
2. Program Compilation
3. Program Execution
UNIX/LINUX Environment
1. Program Creation
* In UNIX C file can be created using vi editor as-
$ vi filename.c
* You can save this file by using ESC key and SHIFT+zz key.
2. Program Compilation
* Program created in first step can be compiled using following command as-
$cc filename.c
* If your program contains mathematical operations the compile it as-
$cc filename.c -lm
* Compiled file which can be used for execution is stored in the file a.out
* If you want your file to saved with specified name then compile it as follows-\
$cc filename.c -o executablename
3. Program Execution
* Executable file can be executed by following command-
$ a.out
or $ executablename
NOTE - $ is the unix prompt also known as shell prompt. it is the main way of accessing programs and doing work on the system.
MS-DOS Environment
1. Program Creation
* Program can be created using any text editor like notepad ,notepad++ and should be saved with .c extension.
2. Program Compilation
* Program can be compiled in command prompt by following command
C:\>tcc filename (in Turbo C)
C:\>bcc filename (in Borland C)
3. Program Execution
* After successfully compiling a c file we need to execute .exe file. It can be done by following command.
C:\>filename
NOTE - In Turbo C ,Compiler is tcc.exe and in Borland C , Compiler is bcc.exe.
Integrated Development Environment
* Integrated development environment is such a tool where program creation , program compilation and program execution is done at single place.
* It provides menu options and shortcut keys for different works.
* In Borland C ,the program bc.exe is IDE and in Turbo C, the program tc.exe is IDE.
* Program can be created by opening a new file from menu option new and can be saved. This created program can be compiled with the help of shortcut Alt+F9.
* To run your program press Ctrl+F9 and Alt+F5
* IDE Provides an easy way to create and develop programs.
Want to Know Top 25 C/C++ IDE : Click Here
Comments
Post a Comment