C Language Detailed Definitions
1. What is C Language?
C is a general-purpose, procedural programming language developed by Dennis Ritchie in 1972 at
Bell Labs. It is widely used for system and application software, and known for its efficiency and
control.
2. Compiler
A compiler is a program that translates C source code into machine code so it can be executed by
the computer.
3. Variable
A variable is a named location in memory that stores a value. It must be declared with a data type
before use.
4. Data Types
C provides several basic data types: int, float, char, double, etc. Each data type defines the type and
size of data a variable can store.
5. Keywords
Keywords are reserved words in C that have special meanings, such as int, return, if, else, while,
for, etc.
6. Constant
A constant is a value that cannot be altered by the program during execution. Defined using
`#define` or `const` keyword.
7. Operators
Operators perform operations on variables and values. Categories include Arithmetic, Relational,
Logical, Bitwise, Assignment, and Unary operators.
8. Expression
An expression is a combination of variables, constants, and operators that produce a result.
9. Statement
A statement is a single line of code that performs a specific action, ending with a semicolon.
10. Function
A function is a block of code that performs a specific task. It enhances code reuse and readability.
11. Header File
Header files contain function declarations and macros. Example: `#include <stdio.h>`.
12. Preprocessor Directive
Commands that are executed before compilation. Example: `#include`, `#define`.
13. Control Statements
Used to control the flow of execution. Includes if, if-else, switch, for, while, do-while.
14. Loop
A loop allows executing a block of code repeatedly. Types: for, while, do-while.
15. Array
An array is a collection of elements of the same type stored at contiguous memory locations.
16. String
A string is a sequence of characters terminated with a null character ''.
17. Pointer
A pointer is a variable that stores the address of another variable.
18. Structure
A structure is a user-defined data type that groups related variables of different types.
19. Union
A union is similar to a structure but shares memory for all its members, saving space.
20. File Handling
Allows programs to read from and write to files. Uses FILE pointers and functions like fopen, fclose,
fprintf, fscanf.
21. Dynamic Memory Allocation
C provides malloc(), calloc(), realloc(), and free() for dynamic memory management.
22. Recursion
A function calling itself is known as recursion. Useful in problems like factorial, Fibonacci series.
23. Storage Classes
Defines the scope, visibility, and lifetime of variables. Includes auto, register, static, extern.
24. Typecasting
Typecasting converts a variable from one data type to another.
25. Enumeration
An enum is a user-defined type consisting of a set of named integer constants.
End of Definitions