0% found this document useful (0 votes)
3 views

c notes

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)
3 views

c notes

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/ 18

C

Boilerplate Comments

Whenever any file is compiled

Data Types and variable

ini alizing mul ple similar datatype variable

Abhishek Singh 1
C

Primitive Data Type

Abhishek Singh 2
C

Scanner Class

Mul ple scan in one me Mul ple prin ng in one me concept count in prin

Scanning word vs sentence

Wrong format to ini alize to print % in sentence ascii value

Abhishek Singh 3
C

Operator Boolean not change into int in java but in c


Boolean convert into int by default

Abhishek Singh 4
C

Data Type Conversion /widening/implicit


conversion
shortint long floatdouble

Type Casting / Narrowing /Explicit


Conversion

Operators
1. Arithme c
a. Binary (mathema cal) operator: + - * / %
b. Unary operator: ++x x++ --x x—
c. Ternary operator: ?:

2. Rela onal ( == != > >= < <= )


3. Logical ( && || ! )
4. Assignment ( = += -= *= %= /=)
5. Bitwise (
a. &(bitwise and)
b. |(bitwise or)
c. <<(shi le )
d. >>(shi right)
e. ~(one’s complement)
f. ^(bitwise exclusive or) )

Abhishek Singh 5
C

Bitwise Operator in detail

Abhishek Singh 6
C

Break and Continue Statement


Break(to exit loop) Con nue(to skip specific condi on itera on)

Output: break

Output: con nue

Math function

String Function

Abhishek Singh 7
C

Conditional Branching/Selectional
Control/Decision Making
If Statement if else Statement if only one statement

Else if Statement Nested if Statement

Switch statement

Abhishek Singh 8
C

Loop Statement
1)Exit Controlled Loop/post tested loop (do while loop)

2)Entry Controlled Loop/pre tested loop (for loop, while loop)

Abhishek Singh 9
C

Function
 func on overloading (same name different parameter or same name but parameter
datatype different) is not supported in c

Here value is passed in func on by call by value and call by reference.

Call by value Call by reference

Macros and macro functions

typedef

Abhishek Singh 10
C

#preprocessor directive

Clear console screen function

getchar () and putchar () function for scanning and printing


character

Abhishek Singh 11
C

Array
For understanding only
1. Int dim[row]
2. Int dim2[row][column]
3. Int dim3[depth][row][column] (generally not used but can be)

 Row=sizeof(dim)/sizeof(dim[0])
 Column= sizeof(dim[0])/sizeof(dim[0][0])

One dimensional Array

Mul dimensional Array


2d and 3d array and many more

Abhishek Singh 12
C

Recursion
1. Base case
2. Work
3. Inner case

Abhishek Singh 13
C

Structure
In main Globally

Union
In main Globally

Abhishek Singh 14
C

Pointer
Declara on

Type of pointer: Pointer and Double Pointer

*p mean value of &x(address x)

*t mean value of &p(address p)

**t mean value of &x(address x)

Pointer to array Pointer to func on Pointer to structure

Abhishek Singh 15
C

Memory allocation

Allocating dynamic memory

Changing Size of dynamically allocated

Free the dynamically allocated memory

we are using ptr as array


Abhishek Singh 16
C
file handling (NOT USED IN TODAYS TIME BECAUSE OF MODERN TECHNOLOGY)

Abhishek Singh 17
C

Linked structure/self-referential structure

Abhishek Singh 18

You might also like