C (Programming Language)

C (Programming Language) post thumbnail image

Introduction

In 1972 C language was developed by Dennis Ritchie at Bell Laboratories in USA. It was the extended version of B language and overcame the problems encountered by old programming languages. It was used to create system software like: Database Systems, Language Interpreters, Compilers and Assemblers, Network Drivers, Text Editors, Print Spoolers, Word Processers etc.

If you want to learn programming language than Visit codingra.com

•FEATURES

Even after the arrival of various other languages C still marks its importance in the concurrent world and justifies its existence due to its robustness. The most common features of C are:
Function Rich Libraries- Inbuilt functions and operators to solve any complex problem. Supports inbuilt libraries also.

 
Portable- Can be written on any operating system at any device.
 
Fast And Efficient- Programs written are executed in less time due to its data types and operators.
 
Variety Of Datatypes And Operators- Combination of assembly, machine and high level language. Used to interact with low-level system memory and hardware.
 
Easy To Extend- Languages like C++, C#, Python, Java, JavaScript, Perl, PHP etc were derived from C.
 
Modularity- A program is broken into different modules to be executed and this increases the efficiency of the program.

•ADVANTAGES

1. Easy to learn, use, reliable and portable.

2. Fully fledged set of features, small programs to OS can be created.

•DISADVANTAGES

1. Difficult to debug.

2. Provides no data protection of source code extensively.

3. Doesn’t provide strict datatype checking.

•STRUCTURE

Header Files Inclusion- A header file with .h extension is to be included in a file. It has function declarations and macro definitions.

 
Main Method Declaration- Next in a C program declare the main() function.
 
Variable Declaration- The variables are declared after main() function and before any operation.
 
Body- Comprises operations and functions like searching, printing, calculating and sorting.
 
Return Statement- It refers to the value a function returns after executing a program.

•DATA TYPES

Primary Datatypes are the basic types of data that is usually entered by the user. For eg: int, char, float, and void.

Derived Datatypes are data types forming new data structures for ease of complex programs. For eg: arrays, functions, and C pointers.

User-defined Datatypes can also be created in C language. For eg: Structure, Union, Enumeration etc.

•TOKENS

Tokens are smallest elements of a program that is meaningful to compiler.

1. Character Set- Refers to digits, alphabets, special symbols used to represent information.

2. Keywords- Refers to system defined words with a fixed meaning already known to compiler. They are used in lower case without any white space. There are total 32 keywords in C.

3. Variables- Refers to an entity that may vary during program execution.

4. Constants- Refers to fixed entity that doesn’t change during program execution.

5. Identifiers- Refers to name given C entities like variables, functions etc. to be identified during execution.

6. Escape Sequences/ Backslash Characters- Used to represent certain special characters within string and character literals.

7. Comments- Refers to non executable codes used to provide documentation to the programmer.

8. Operators- Tools / symbols used to perform specific operations. There are almost 45 operators in C of following types:

i. Arithmetic Operator: +,-,/,*,%

ii. Increment / Decrement Operator: ++,–

iii. Relational Operator: ==,<,>,<=,>=,!=

iv. Logical Operator: &&, ||, !

v. Assignment Operator: =,+=,-=,*=, /=, %=

vi. Bitwise Operator: &, |, ^, ~, <<, >>

vii. Misc Operator: Sizeof(), *, &, ?:

•CONCLUSION

C is not becoming outdated but is still used for embedded systems development, mobile application, end user application and socket programming. Even the latest python language is derived from C and is termed as CPython.

Leave a Reply

Your email address will not be published.

Related Post