0% found this document useful (0 votes)
41 views2 pages

C Programming Notes

C is a general-purpose programming language developed in the 1970s, known for its low-level memory access and use in system/software development. The document outlines the basic structure of a C program, data types, control structures, functions, pointers, arrays, structures, and file handling. Key concepts include the syntax for defining functions, using pointers, and performing file operations.

Uploaded by

Soumya Mahbub
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)
41 views2 pages

C Programming Notes

C is a general-purpose programming language developed in the 1970s, known for its low-level memory access and use in system/software development. The document outlines the basic structure of a C program, data types, control structures, functions, pointers, arrays, structures, and file handling. Key concepts include the syntax for defining functions, using pointers, and performing file operations.

Uploaded by

Soumya Mahbub
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

C Programming Notes

1. Introduction to C

C is a general-purpose, procedural programming language developed in the early 1970s by Dennis

Ritchie. It provides low-level access to memory and is widely used for system/software

development.

2. Basic Structure of a C Program

#include <stdio.h>

int main() {

printf("Hello, World!\n");

return 0;

3. Data Types in C

Primary data types: int, float, char, double

Derived data types: array, pointer, structure, union

Qualifiers: signed, unsigned, long, short

4. Control Structures

Conditional: if, if-else, switch

Loops: for, while, do-while

Jump: break, continue, goto, return

5. Functions

A function is a block of code that performs a specific task. Syntax:

return_type function_name(parameters) {

// body
}

6. Pointers

A pointer is a variable that stores the memory address of another variable. Use * for value at

address, & for address of a variable.

7. Arrays and Strings

Array is a collection of elements of the same type. Strings are arrays of characters ending with a null

character '\0'.

8. Structures

Structures are user-defined data types that group related variables of different types. Syntax:

struct StructName {

int a;

char b;

};

9. File Handling

C provides functions like fopen, fclose, fprintf, fscanf for file operations. Modes include "r", "w", "a",

"r+", etc.

You might also like