0% found this document useful (0 votes)
4 views3 pages

C_Language_Revision_Notes

C is a high-level procedural programming language created by Dennis Ritchie in 1972, essential for system-level programming. Key concepts include tokens, data types, control statements, functions, pointers, and memory management. The document also outlines the differences between structures and unions, as well as provides a memory trick for recalling important C language components.

Uploaded by

hu33ai9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

C_Language_Revision_Notes

C is a high-level procedural programming language created by Dennis Ritchie in 1972, essential for system-level programming. Key concepts include tokens, data types, control statements, functions, pointers, and memory management. The document also outlines the differences between structures and unions, as well as provides a memory trick for recalling important C language components.

Uploaded by

hu33ai9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

C Language Quick Revision Notes

1. What is C Language?

C is a high-level, procedural programming language developed by Dennis Ritchie in 1972. It is foundational for

system-level programming.

2. Tokens in C:

Tokens are the smallest units in a program, categorized as Keywords, Identifiers, Constants, Operators, Special

symbols, and Strings.

3. Keywords:

Reserved words in C such as int, return, void, etc.

4. Variables and Constants:

Variable: Named storage (e.g., int x = 10;)

Constant: Immutable value (e.g., const int y = 5; or #define PI 3.14)

5. Data Types:

Basic: int, float, char, double

Derived: arrays, pointers, functions

User-defined: struct, union, enum

Void: indicates absence of value

6. Operators:

- Unary: ++, --

- Binary: Arithmetic (+, -, *, /, %), Relational (<, >, ==), Logical (&&, ||, !)

- Ternary: condition ? true : false

7. Input/Output Functions:

- scanf("%d", &x); printf("x = %d", x);

- getchar(); putchar('A');

8. Control Statements (with Definitions):

- if: Executes a block if condition is true.


- else: Executes when 'if' condition is false.

- switch: Allows multi-way branching.

- for: Repeats block with initialization, condition, and update.

- while: Entry-controlled loop executing while condition is true.

- do-while: Exit-controlled loop; executes at least once.

- break: Terminates loop or switch prematurely.

- continue: Skips current iteration and proceeds to next loop cycle.

9. Arrays:

Collection of same data type.

- Declaration: int a[5];

- 2D Array: int mat[2][2];

10. Strings:

Array of characters ending with ''.

- Functions: strlen(), strcpy()

11. Functions:

Reusable code block. Syntax: return_type func_name(params)

- Call by Value: Passes value (no change to original)

- Call by Reference: Passes address (original can change)

12. Pointers:

Holds address of another variable.

- Syntax: int *p = &x;

13. malloc and free:

Dynamic memory allocation and deallocation.

14. Structures:

User-defined type with multiple data fields.

- Access: struct student s; s.id = 1;


15. Unions:

Similar to structures but share memory.

- Only one member holds value at a time.

16. Difference: Structure vs Union:

Structure allocates separate memory for each member; Union shares same memory. Structure can store multiple

values; Union only one at a time.

17. Enum:

Used to define named integer constants.

Memory Trick: KOD VIC CAFS PUS

(Knowledge, Operators, Data types, Variables, Input/Output, Control, Arrays, Functions, Strings, Pointers, Union,

Structure)

You might also like