Environment for C

The steps involved in developing a C program are –
A. Program Creation
B. Program compilation
C. Program Execution

UNIX/LINUX Environment:
                        Requirements for UNIX are Terminal(ctrl+alt+t), Text editor like vim, gedit, emacs, …. And Compiler. Examples are written by using Vim editor and compilation by GCC Compiler. 
To install this, type the command in terminal 
                                                “apt-get install vim “(for debian pkg) and 
                                                 GCC is default one of the GNU tools.
a.    program creation:
            $vim filename.c
press insert and type the program in this file after completing press ESC and :wq it save and exits from terminal.
b.    Program compilation:
            $ gcc filename.c
After successful compilation you get binary file: a.out in that current directory.
You want to give user defined name to binary then follow this
$ gcc filename.c -o user_name
After successful compilation you get binary file: user_name in that current directory.
                               c. Program execution: 
                                           $./a.out   or 
                                           $./user_name. 
  Then Out put is displayed in the terminal. 

Share this

Related Posts

Previous
Next Post »