C Language: A Powerful Tool of ERA
What basically “C” is?
C is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. Its design provides constructs that map efficiently to typical machine instructions, and to require minimal run-time support. C is therefore useful for many applications that had formerly been coded in assembly language, such as in system programming. Operating system programs such as Windows, Unix, Linux are wriiten by C language.
There are many new powerful programming languages available in the market but why C is still popular?
C language is a very powerful language the major use of C language is done while programming for system/system resources. Many popular operating system are written in C language like unix, linux, windows which covers major share of computer system.
C language provides the functionality to interact with low level hardware system effectively and efficiently. Despite its low-level capabilities, the language was designed to encourage cross-platform programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with few changes to its source code. The language has become available on a very wide range of platforms, from embedded microcontrollers to supercomputers. One powerful reason is also memory allocation Capabilities. Unlike most computer languages, C allows the programmer to write directly to memory.
Why it is good to learn “C” /Why to Learn “C” when there are more programming languages available in market?
As we know “C” is widely used language for development of system programs and provide power to use system resources efficiently and effactively.
Many Popular programming languages like D, Go, Rust, Java, JavaScript, Limbo, LPC, C#, Objective-C, Perl, PHP, Python, Verilog (hardware description language) and Unix's C shell . These languages have drawn many of their control structures and other basic features from C and also very syntactically similar to C in general.
Many Graphics packages, Database systems, Word processors, Compilers and Assemblers, Network drivers packages are written in c language.
Development of “c”/History of “c”
“C” language was developed by Dennis Ritchie. The origin of C is closely tied to the development of the Unix operating system, originally implemented in assembly language on a PDP-7 by Ritchie and Thompson. The developers were considering to rewrite the system using the B language. However B's inability to take advantage of some of the PDP-11's features, notably byte addressability, led to the development of C. The initial development of C occurred at AT&T Bell Labs between 1969 and 1973.After the addition of struct type the c become powerful enough that most of the unix kernel was now written in c . The new language was named "C" because its features were derived from "B".
Standards of C language:
- C89/C90 standard – First standardized specification for C language was developed by American National Standards Institute in 1989. C89 and C90 standards refer to the same programming language.
- C99 standard – Next revision was published in 1999 that introduced new futures like advanced data types and other changes.
- C11 standard – This standard adds new features to C and library like type generic macros, anonymous structures, improved Unicode support, atomic operations, multi-threading, and bounds-checked functions. It also makes some portions of the existing C99 library optional, and improves compatibility with C++.
- Embedded C – It includes features not available in normal C like fixed-point arithmetic, named address spaces, and basic I/O hardware addressing
How To Develop a simple program using C?
Before start writing a simple program in “C” we need a compiler to run or say execute “C” program so that it can run on the system.
Now the question arises what Basically a “compiler” is?
Compiler is a computer program which reads source code and output assembly or executable code is called compiler .compiler compiles code in different phases such as
- Lexical analysis phase
- Syntax analysis
- Semantic analysis
- Intermediate code generation
- Code optimization
- Code generation.
Many compiler are available in the market for executing “c” program few of them are:
Turbo c++ complier(used for compiling both c & c++)
Borland c++ compiler(used for compiling both c & c++)
Microsoft Visual c++ compiler(used for compiling both c & c++)
Simple program:
S.no | Command | Explanation |
1 | #include <stdio.h> | This is a preprocessor command that includes standard input output header file(stdio.h) from the C library before compiling a C program |
2 | void main() | This is the main function from where execution of any C program begins. |
3 | { | This indicates the beginning of the main function. |
4 | /*_some_comments_*/ | whatever is given inside the command “/* */” in any C program, won’t be considered for compilation and execution. |
5 | printf(“Hello_World! “); | printf command prints the output onto the screen. |
6 | } | This indicates the end of the main function. |
Name - Sonu Gupta June 10, 2014 at 4:47 am
Sonu Gupta liked this on Facebook.
Name - Rahul Panchal June 10, 2014 at 4:47 am
Rahul Panchal liked this on Facebook.
Name - Tasleem Ali June 10, 2014 at 4:47 am
Tasleem Ali liked this on Facebook.
Name - Yatin Khanna June 10, 2014 at 5:45 am
Yatin Khanna liked this on Facebook.
Name - Garima Saini June 10, 2014 at 11:09 pm
Garima Saini liked this on Facebook.