C is a programming language developed in 1972 at AT & T’s Bell Laboratories.
We write a C program using an editor and save the file with dot C extension. This file is known as our source code. Here in our example we have given our file name as my_first_prg.c .
Editor
We need one editor to write c program ( source code ) . We can use notepad as an editor but it lacks advance capability like syntax highlighter, help / suggestion etc. There are special editors available for writing C code and that helps in improving productivity.
Compiler
We need a compiler to transform our source code to machine executable code. The compiler is available based on the operating system we are using. Since output of compiler is executable by operating system of the computer so a C compiler for windows is different than a c compiler for Unix. Same way compilers are developed based on specific requirement.
Integrate Development Environment (IDE) for C
There are IDE available with good quality editor and compiler as an integrated platform. It also allows you to select your own compiler. With graphical user interface ( GUI), easy to use buttons, debuggers , file browsers and code retrieval , saving as project etc , IDE helps in developing complex programs.
However beginners should avoid using IDE to understand the process by using simple editor and separate compiler.
Advantage of Learning C
Programming languages like PHP, C++, Java etc uses c programming concepts. By using C we can learn basic programming structure and it helps in learning advance programming languages.
The core C programming is still in use in many advance programming languages.
By using C we can program for new devices and develop drivers for interfacing with our operating systems.
The Operating Systems for Microprocessor based embedded equipment like washing machine, digital cameras are written in C.
Because of its speed and accessibility to hardware , many Games are written using C program.
Reserved words
There are keywords which can’t be used as variables as compliers have used them. Some of such reserved keywords are here.
Declaring reading and assigning value to Structures
Common Codes in C
To stop immediately closing of screen after executing the code you can integrate this code with your code. This will ask user to enter any char to close the program execution.
#include <stdio.h>
int main(){
char str_to_end;
printf(" Enter one char ");
str_to_end=getchar();
printf(" You entered %c \n",str_to_end);
return 0;
}
Clearing the screen having previous program outputs
#include <stdio.h>
#include <conio.h>
int main(){
char str_to_end;
printf(" Enter one char ");
str_to_end=getchar();
printf(" You entered %c \n",str_to_end);
clrscr();
return 0;
}