C Language Programming – INTRODUCTION
C language Programming is a mid-level, statically typed, general purpose, imperative programming language which follows procedural paradigm.
C Language Programming – HISTORY
- C language programming languag first released in 1972
- It was developed by Dennis Ritchie at bell laboratories located in USA.
- Dennis Ritchie is known as the founder of C
- It was developed with the aim of developing UNIX os.
- C is the successor of B language
- C is written in assembly language
- C took several features from its predecessors but also incorpated some unique & new features by its own too.
- C is the most widely used and popular System Programming language.
PROS
- C is the mother of most of the modern languages cause it inspired syntax, concepts, features etc.
- Even after being a grandmother language by age many programmers are in love & several has crush on C, C was that modern girl who was way ahead of her friends intellectually & physically. Meaning, even at that stone age C provided a quite decent set of inbuilt functionalities in the C Library.
- The procedural way of writing code makes debugging, maintenance, and testing easier.
- Due to C being a mid-level lang it gives u that extra contol over computer allowing u to pass more precise instructions than high-level langs & also giving that ease of writing, understanding, debugging and maintaining the code.
- It’s the fastest in the array of popular & widely used languages due to being a mid-level lang.
- It’s portable
- C is a structured programming language meaning the whole program is made up of small, separate & structured functions or blocks. Collection of these blocks makes a complete program. This block-based structure makes program debugging, testing and reading easier.
CONS
- Currently most of the modern languages have OOP paradigm but C only has procedural paradigm reducing its flexibility & downgrading developer’s love for C cause currently OOP is loved & desired by most of developers.
- The fundamental structure of a language is designed so carefully by keeping the aim & future plans of language in mind because future addition of features in the language solely depends on it’s fundamental structure, every new feature must align properly with the fundamental structure otherwise a bug will originate & if its big enough then it might break the entire language. Due to C being an old language its fundamental structure is also old blocking it to add any new modern feature into the language.
- Exception Handling is so vital feature that every modern language must have it but that’s not the case with old languages and C is not an exception. C doesn’t offer any exception handling feature(or almost don’t offer) which makes development tough.
- C doesn’t have any runtime checking mechanism, meaning it doesn’t check for errors while the code is executing or running. This thing is a big drawback cause even a developer’s small mistake may lead to a runtime based error reducing UX.
C Language Programming | Definition | History
APPLICATION
- It’s still considered the best lang to develop system softwares because system softwares needs to have close contacts with hardware & C manages to do that very well.
- Best for developing compilers & interpreters because their priority is speed & due to C being a mid-level lang it compiles to binary faster than any other high-level lang.
- Best for developing OSs due to its low-level language features.
- One of the best lang for database development due to its low-level language features (mainly speed & memory management)
- One of the best lang for embedded programming due to its low-level language features(mainly close control over hardware).
𝗖𝗢𝗠𝗣𝗜𝗟𝗔𝗧𝗜𝗢𝗡 𝗣𝗥𝗢𝗖𝗘𝗦𝗦
There are 4 steps included in the compilation process of a C sourcecode file
EXPRESSION & OPERATOR
EXPRESSION –
Any piece of code that evaluates to a value. An expression “might” contain 1 or more of these things – [ variables, literals, operators, function calls ].
EXAMPLE ➡
➊
71 – 70 / 7 + 0.2 * 13 ➡ 63.6
⬇ ⬇
piece of code ➡ value
⬇ ↘️
expression ↩
➋
a = 3
b = a != 2
print(b) ➡ 1 (true) 3 ➡ Expression
variable a ➡ Expression
variable b ➡ Expression
a != 2 ➡ Expression
𝗜𝗡 𝗖 𝗧𝗛𝗘𝗥𝗘 𝗔𝗥𝗘 𝟰 𝗧𝗬𝗣𝗘𝗦 𝗢𝗙 𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡𝗦 –
𝗔𝗥𝗜𝗧𝗛𝗠𝗘𝗧𝗜𝗖 𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡 – An expression which evaluates / returns a numeric (int or decimal) value. They are used to perform mathematical operations using arithmetic or assignment or increment/decrement operators or all of them together.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
a = 1
print ( a *= 9 + a * 1.381 – 81 % 16 + ++a -7 )
*variable * a ➡ Ar expression
1 ➡ Ar expression
data inside print ➡ Ar expression
𝗥𝗘𝗟𝗔𝗧𝗜𝗢𝗡𝗔𝗟 𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡 – An expression which is constituted of condition/s which evaluates to 1 if condition/s is True and 0 if False. They are used when decision making needs to be done.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
➊
if (25 > 19) // (true)➡ 1
print(“hello”)
➋
(71 != 1) <= 0 ➡ 0
⬇
1 (true)
⬇
1 <= 0
⬇
0 (false)
C Language Programming
𝗟𝗢𝗚𝗜𝗖𝗔𝗟 𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡 – Combination of 2 or more relational expressions. This expression is constituted of 2 or more conditions which evaluates to 1 if condition/s is True and 0 if False.
They are used when complex decision making needs to be done.
𝗖𝗟𝗜𝗘𝗡𝗧 – A device or software that Requests Services from the Server is called client.
𝗦𝗘𝗥𝗩𝗘𝗥 – A device or software that Provides Services to the Client is called server.
𝗔𝗣𝗜 – Application Programming Interface. A program which acts as a Middleman to make communication possible between the Client & the Server.
➊ It receives the request from the client
➋ It explains(interprets) the request to the server
➌ It receives the service from the server
➍ It explains(interprets) the request to the client
API’s make it way easier & efficient for the client to communicate & use server.
𝗗𝗔𝗧𝗔 𝗙𝗢𝗥𝗠𝗔𝗧 – A Different, A Unique way of Representing data.
𝗧𝗘𝗫𝗧 𝗙𝗢𝗥𝗠𝗔𝗧 – A type of data-format which represents data using plain text characters.
𝗝𝗦𝗢𝗡 – A text-format.
𝗨𝗦𝗘𝗦 𝗢𝗙 𝗝𝗦𝗢𝗡 :–
— The data which is transferred back & forth between Server & Client is stored in a json file
— JSON is used as a configuration file in apps & games
— JSON is used as a database
𝗕𝗘𝗡𝗘𝗙𝗜𝗧𝗦 𝗢𝗙 𝗝𝗦𝗢𝗡 :–
— Lightweight
— Easy to Read
— Easy to Write
— Integrates easily with most of the languages
𝗝𝗦𝗢𝗡 𝗗𝗔𝗧𝗔-𝗧𝗬𝗣𝗘𝗦 :–
— String
— Number(integer+decimal)
— Boolean
— Null
— Array
— Object
𝗖𝗢𝗡𝗗𝗜𝗧𝗜𝗢𝗡𝗔𝗟 𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡 – It’s a combination of 1 condition based expression and 2 expressions. They are used when condition based task-execution needs to be performed. It’s referred as concise form of “if-else”.
𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥 – A symbol which performs a specific operation on operand / operands.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ +, /, >=, ||, %= etc
𝗢𝗣𝗘𝗥𝗔𝗡𝗗 – Part of program on which operation is performed.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ 18 + atoi( “61” ) / 1
⬇ ⬇ ⬇
operand op op
𝗨𝗡𝗔𝗥𝗬 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥 – Operators which act on a single operand.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ ++ — ! etc
𝗕𝗜𝗡𝗔𝗥𝗬 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥 – Operators which require 2 operands to act.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ + >= || == etc
𝗧𝗘𝗥𝗡𝗔𝗥𝗬 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥 – Operators which require 3 operands to act.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ ?:
C Language Programming – 𝗧𝗬𝗣𝗘𝗦 𝗢𝗙 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 –
- Arithmetic ➡ Arithmetic Expression
- Relational
- Logical
- Assignment ➡ Arithmetic Expression
- Increment and Decrement ➡ Arithmetic Expr
- Conditional
- Bitwise ➡ No particular belongings
- Special ➡ No particular belongings
𝗡𝗢𝗧𝗘 : Bitwise & Special operators don’t belong to Arithmetic Expression category because the operators they contain aren’t mathematical operators & Arithmetic == Mathematical calculation == Mathematical Operators.
𝗔𝗥𝗜𝗧𝗛𝗠𝗘𝗧𝗜𝗖 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦- Operators used to perform mathematical operations. It contain both binary & unary operators.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ + – * / % ++ —
𝗥𝗘𝗟𝗔𝗧𝗜𝗢𝗡𝗔𝗟 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – Operators used to compare operands with each other. It contain binary operators.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ == != <
𝗟𝗢𝗚𝗜𝗖𝗔𝗟 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – Operators used to attach several conditions / relational expressions together. It contains both unary & binary operators.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ && || !
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
𝗔𝗦𝗦𝗜𝗚𝗡𝗠𝗘𝗡𝗧 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – Operators used to assign result of an expression to a variable. It’s a unary operator.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ = += -= *= /= %= <<=
= &= ^= |=
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
b = 1.2
c = “”
➊ a = b-6*9%1+0.2
⬇ ⬇ ⬇
variable assignment expression
operator
➋ c += “hi mummy”
⬇ ⬇ ⬇
variable assignment expression
operator
𝗜𝗡𝗖𝗥𝗘𝗠𝗘𝗡𝗧 & 𝗗𝗘𝗖𝗥𝗘𝗠𝗘𝗡𝗧 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – Operators used to add or subtract ‘integer 1’ from a variable. It’s a unary operator.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ ++ —
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
int a = 1
float b = 3.121
➊ a++ ➡ 2
➋ b++ ➡ 4.121
𝗖𝗢𝗡𝗗𝗜𝗧𝗜𝗢𝗡𝗔𝗟 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – This operator is used when condition based task-execution needs to be performed. It’s a ternary operator.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ ?:
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
a = 2 ;
b = 1 ;
( a > b ) ? a– : b++ ;
⬇ ⬇ ⬇
condition task 1 task 2
condition
print(a) ➡ 1
print(b) ➡ 1
C Language Programming | Definition | History
𝗕𝗜𝗧𝗪𝗜𝗦𝗘 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – Operators used to perform operation on bits. It contain both unary & binary operators. Only integers can be operands of these operators. Performing operations on bits is known as bit-level programming.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ & | ^ << >>
𝗦𝗣𝗘𝗖𝗜𝗔𝗟 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦 – Operators used to perform memory related tasks.
𝐈𝐍𝐂𝐋𝐔𝐃𝐄𝐒 ➡ & * sizeof (operand)
𝗟𝗜𝗧𝗘𝗥𝗔𝗟 – A valid data which is fixed (can’t
change at any cost) is a literal.
𝗩𝗔𝗟𝗜𝗗 𝗗𝗔𝗧𝗔 – String, Char, Int, Float/Double.
𝗧𝗬𝗣𝗘𝗦 𝗢𝗙 𝗟𝗜𝗧𝗘𝗥𝗔𝗟 –
- Char
- String
- Int
- Float/Double
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ “hi”, ‘c’, -17, 1.32 etc
𝗖𝗢𝗡𝗦𝗧𝗔𝗡𝗧 – Variable whose value remains same throughout entire execution of program is a constant. Both Constants and Normal variables store literals as value but the difference is normal variables can replace those literals with other values/literals whereas constants can’t.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
➊ const int a = 1;
Here variable “a” is a constant thus it’s value will remain 1 throughout the entire execution of the program.
➋ int b = 1;
Here variable “b” is a normal one thus it’s value can be changed/replaced throughout the execution of the program.
- DATA STRUCTURE —
A way or method to store, manage and use data efficiently.
OR
A thing which can store data inside it and which allows users to perform wished operations or tasks using it’s data.
C Language Programming – TYPES OF DATA STRUCTURES–
:: BUILTIN DATA STRUCTUTES– List,Tuple, Dictionary etc
:: USER DEFINED DATA STRUCTURES– Stack, Queue etc.
- Dynamically typed languages – These are a kind of language in which the data-type of a variable’s value, function’s return value, data-structure’s value isn’t fixed(they can be changed anytime) & we don’t need to explicitly define types of these things too.
EX- JS, Python etc - Statically typed languages – These are a kind of language in which the data-type of variable’s value, function’s return value, data structure’s value is fixed(meaning you can’t put a value of int if you specified a variable to be string while it’s declaration). Here you need to explicitly define types of these but in modern static typed langs most of them have a feature named type inference which basically means that “the compiler will set the type of your variable or whatever by simply looking at its value” so that u don’t have to write it.
EX- Dart, Java etc
a = “sam”
a = 6.21
In a dynamically typed lang it’s entirely possible to put value of any data type in variables or whatever whenever u wish as shown above but in a statically typed language you have to first change the type of your variable or whatever it is to the type of value you wanna store as shown below.
a=”sam”
float(a)
a=6.21
. 𝗔𝗥𝗥𝗔𝗬
An array is a data-structure whose properties are :-
(i) Fixed in size (can’t add or remove elements from array, can only update them).
(ii) All elements have the same data-type.
(iii) It’s elements are stored at contiguous memory locations.
𝗜𝗠𝗣𝗘𝗥𝗔𝗧𝗜𝗩𝗘 𝗟𝗔𝗡𝗚𝗨𝗔𝗚𝗘 – how – the process
𝗗𝗘𝗖𝗟𝗔𝗥𝗔𝗧𝗜𝗩𝗘 𝗟𝗔𝗡𝗚𝗨𝗔𝗚𝗘 – what – the goal
𝗦𝗬𝗦𝗧𝗘𝗠 𝗦𝗢𝗙𝗧𝗪𝗔𝗥𝗘 –
𝗔𝗣𝗣𝗟𝗜𝗖𝗔𝗧𝗜𝗢𝗡 𝗦𝗢𝗙𝗧𝗪𝗔𝗥𝗘 –
𝗩𝗜𝗥𝗧𝗨𝗔𝗟 𝗠𝗔𝗖𝗛𝗜𝗡𝗘 –
𝗖𝗢𝗠𝗠𝗨𝗡𝗜𝗧𝗬 – A group of people who contributes in the development of a project
in literally any way.
𝐄𝐗 – People who are contributing in Flutter’s development in any way are the part of “Flutter Open Source Community” or simply “Flutter Community” because flutter is open-source whereas people contributing to a closed-source project are referred as “TechnologyX Closed Source Community” or “TechnologyX Community”, Flutter Stackoverflow community, Flutter GitHub, Flutter Discord.
+
When 2 ≥ people with the same interest form a group by coming together, they form a community. A community is a group of people who share similar interests.
𝐄𝐗 – • “Flutter” YouTube
• “r/FlutterDev” Reddit
• “flutter” GitHub
𝗙𝗜𝗟𝗘 𝗘𝗫𝗧𝗘𝗡𝗦𝗜𝗢𝗡 –
𝗔𝗣𝗞
𝗜𝗣𝗔
𝗘𝗫𝗘
𝗔𝗣𝗣
𝗔𝗥𝗠 –
{
𝗘𝗠𝗕𝗘𝗗𝗗𝗘𝗗 𝗦𝗬𝗦𝗧𝗘𝗠 – Computer software nested inside a computer hardware is called an embedded system.𝗪𝗢𝗥𝗞𝗜𝗡𝗚 - Take physical input ➡ Perform task accordingly ➡ Give physical output 𝗖𝗛𝗔𝗥𝗔𝗖𝗧𝗘𝗥𝗜𝗦𝗧𝗜𝗖𝗦 - • They are designed to perform a very limited set of tasks or a single task. • 3 things are must in an embedded system : 𝘗𝘙𝘖𝘊𝘌𝘚𝘚𝘖𝘙 : have memory chip + perform calculations . 𝘙𝘌𝘈𝘓𝘛𝘐𝘔𝘌 𝘖𝘚 : Resposible for handling input-output operations in real time. 𝘈𝘗𝘗𝘓𝘐𝘊𝘈𝘛𝘐𝘖𝘕 𝘚𝘖𝘍𝘛𝘞𝘈𝘙𝘌 : Resposible for performing the actual function of product. • Memory and Processor capacity is low as it only have to perform less tasks.
• An embedded system has some kind of input
output device embedded in it.
• An embedded system might be a standalone
product or part of a larger product.𝗘𝗠𝗕𝗘𝗗𝗗𝗘𝗗 𝗣𝗥𝗢𝗚𝗥𝗔𝗠𝗠𝗜𝗡𝗚 - Creating application software + realtime os and merging these with the whole system so that it works properly OR software side development of embedded systems is referred as embedded programming. 𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ Car, Drone, TV, Digital Alarm, Missile, Fire Alarm, ATM, Smartwatch etc
}
𝗔𝗦𝗦𝗘𝗠𝗕𝗟𝗬 𝗟𝗔𝗡𝗚𝗨𝗔𝗚𝗘 –
𝗔𝗦𝗦𝗘𝗠𝗕𝗟𝗘𝗥 –
{
𝗖𝗢𝗠𝗣𝗜𝗟𝗘 𝗧𝗜𝗠𝗘 – The time during which source code file gets converted to an executable file.
𝗥𝗨𝗡 𝗧𝗜𝗠𝗘 – The time during which the executable file is getting executed or “running”.
𝐂𝐎𝐌𝐏𝐈𝐋𝐀𝐓𝐈𝐎𝐍 – The conversion of source code file to an executable file.
𝐓𝐑𝐀𝐍𝐒𝐏𝐈𝐋𝐀𝐓𝐈𝐎𝐍 – The transition of one language to another is called transpilation.
The tool which performs it is called transpiler.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ Head on to “COMPILATION PROCESS” of C
𝗖𝗢𝗠𝗣𝗜𝗟𝗘 𝗧𝗜𝗠𝗘 𝗘𝗥𝗥𝗢𝗥𝗦 –
𝗥𝗨𝗡 𝗧𝗜𝗠𝗘 𝗘𝗥𝗥𝗢𝗥𝗦 –
.
}
𝗦𝗧𝗔𝗧𝗘𝗠𝗘𝗡𝗧 – A piece of code that performs a task.
𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡 – A piece of code that evaluates to a value. An expression “might” contain 1 or more of these things – [ variables, literals, operators, function calls ].
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
𝗦𝗧𝗔𝗧𝗘𝗠𝗘𝗡𝗧 𝘃𝘀 𝗘𝗫𝗣𝗥𝗘𝗦𝗦𝗜𝗢𝗡 – Any piece of code that can be evaluated to a single value is an expression.
&
Anything that can’t be evaluated to a single value is a statement.
𝐈𝐃𝐄𝐍𝐓𝐈𝐅𝐈𝐄𝐑 – Names allotted to programming entities like variables, functions, data-types, classes etc inorder to identify them uniquely.
𝗟𝗜𝗧𝗘𝗥𝗔𝗟 – A valid data which is fixed (can’t
change at any cost) is a literal.
𝗧𝗬𝗣𝗘𝗦 𝗢𝗙 𝗟𝗜𝗧𝗘𝗥𝗔𝗟 {in modern langs} –
➊ Char
➋ String
➌ Int
➍ Float
➎ Boolean
Etc
EXAMPLE – “HI”, -62, 0.28, true, ‘j’ etc
C Language Programming
𝗖𝗢𝗡𝗦𝗧𝗔𝗡𝗧 – Variable whose value remains same throughout entire execution of program is a constant. Both Constants and Normal variables store literals as value but the difference is normal variables can replace those literals with other values/literals whereas constants can’t.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡
➊ const int a = 1;
Here variable “a” is a constant thus it’s value will remain 1 throughout the entire execution of the program.
➋ int b = 1;
Here variable “b” is a normal one thus it’s value can be changed/replaced throughout the execution of the program.
{
𝗗𝗔𝗧𝗔 𝗥𝗘𝗔𝗗𝗜𝗡𝗚 – Accessing data from memory.
𝗗𝗔𝗧𝗔 𝗪𝗥𝗜𝗧𝗜𝗡𝗚 – Adding or Deleting data in memory.
𝗠𝗘𝗠𝗢𝗥𝗬 – A physical device capable of storing data in it temporarily or permanently is referred as Memory. Fundamentally, Memory is an array of Bytes where each Byte has it’s own unique memory address.
𝗠𝗘𝗠𝗢𝗥𝗬 𝗜𝗦 𝗠𝗔𝗜𝗡𝗟𝗬 𝗗𝗜𝗩𝗜𝗗𝗘𝗗 𝗜𝗡 𝟮 𝗧𝗬𝗣𝗘𝗦 –
➊ 𝗣𝗥𝗜𝗠𝗔𝗥𝗬 𝗠𝗘𝗠𝗢𝗥𝗬 (Internal Memory) –
- This kind of memory is placed inside the device.
- It contains both volatile & non-volatile form
of memories.
DATA-READING ➡ Here data is directly shipped from RAM to processor for execution hence data-reading in primary memory(RAM) is faster than secondary memories. - Primary Memory is costlier than Secondary Memory. 𝗡𝗢𝗧𝗘 : Most of the modern day PCs have
replaced ROM with secondary storages like
SSD because it’s illogical to have a
separate memory storage for storing that
little data that’s why nowadays few people
put RAM only in Primary Memory category
thus they sometimes refer RAM by the name
Primary Memory. 𝗡𝗢𝗧𝗘 : RAM don’t store any data of its own, it
just stores data shipped from ROM &
secondary storages. All the files, programs &
data are stored in ROM & secondary storages
hence whenever they are read/opened by the
user/os that particular data’s copy gets
stored in RAM so that the user/os don’t have
to open that data from ROM/SECONDARY
STORAGES again & again because in case of
data reading ROM/SECONDARY STORAGES
are much slower than RAM. 𝗜𝗧’𝗦 𝗗𝗜𝗩𝗜𝗗𝗘𝗗 𝗜𝗡 𝟮 𝗧𝗬𝗣𝗘𝗦 – ➊ 𝗥𝗢𝗠 - It's a non-volatile form of memory which is used to store data permanently. Data stored remain as it is even after the device runs out of power. You can only read from this memory, can't write in it meaning data is only once written in it by it's manufacturers but after that it's not allowed. ROM is used to store only data (instructions) about OS's functionalities + working process or PC's on/off process or both. 𝗕𝗔𝗦𝗜𝗖𝗔𝗟𝗟𝗬 𝗜𝗧'𝗦 𝗗𝗜𝗩𝗜𝗗𝗘𝗗 𝗜𝗡 𝟱 𝗧𝗬𝗣𝗘𝗦 - • MROM • PROM • EPROM • EEPROM • Flash ROM 𝗡𝗢𝗧𝗘 : In early days ROMs were only used to store data about OS's functionalities + working process or PC's on/off process or both but in most of the modern PCs ROM is replaced with secondary storages like SSD meaning ROM no longer exists.
- ➋ 𝗥𝗔𝗠 – It’s a volatile form of memory which is used to store data temporarily. Data stored gets permanently deleted as soon as
the device runs out of power. You can both
read & write in this memory. 100% of ur
personal data is stored in secondary storage
thus when you open a file, program etc then
a copy gets created of that particular data
of secondary storage and then that copy
gets loaded / stored into RAM.
𝗜𝗧’𝗦 𝗠𝗔𝗜𝗡𝗟𝗬 𝗗𝗜𝗩𝗜𝗗𝗘𝗗 𝗜𝗡 𝟮 𝗧𝗬𝗣𝗘𝗦 –
• SRAM
• DRAM
➋ 𝗦𝗘𝗖𝗢𝗡𝗗𝗔𝗥𝗬 𝗠𝗘𝗠𝗢𝗥𝗬 (Auxiliary Memory) –
- This kind of memory is a separate hardware which is placed inside the device or connected to the device from outside.
- Secondary Memory is always non-volatile form of memory.
DATA-READING ➡ Here, data in is indirectly shipped to the processor for execution, first, copy of the data of secondary storage gets loaded/written into primary storage(RAM) & then shipped to the processor for execution that’s why data-reading in secondary storages is slower than primary storages. - Secondary Memory is cheaper than Primary Memory.
𝐄𝐗𝐀𝐌𝐏𝐋𝐄 ➡ SSD, Pen Drive, DVD, Floppy Disk, Punching Cards etc.
𝗠𝗘𝗠𝗢𝗥𝗬 𝗔𝗗𝗗𝗥𝗘𝗦𝗦 –
Memory == City
Data == A house
Memory address == Location of house in the city
Location of data in the memory is known as memory address of that data. Each Byte of data has it’s own memory address which the processor uses to find & perform operations on the data associated with the address.
𝗕𝗜𝗧 – It’s the most smallest form of data that can exist in a computer’s memory. It’s an acronym of “Binary Digit”.
“Smallest unit to measure data in a computer’s
memory”.
Data which has occupied 1 bit of memory represents a single binary digit meaning in 1 bit either 0 or 1 can get stored.
𝗕𝗬𝗧𝗘 – The number of bits needed to store a single character of data makes up 1 byte. bits needed to create 1 Byte varies from hardware architecture to architecture but in modern times
most hardwares combine 8 bits to make up 1 Byte. An 8-bit Byte can represent 256 unique characters. Bytes are the smallest operable units of computer memory because bits separately can’t reperesent any valid data.
01100010 == 1 Byte
8 bits == 1 Byte 𝗗𝗔𝗧𝗔 𝗠𝗘𝗔𝗦𝗨𝗥𝗘𝗠𝗘𝗡𝗧 𝗖𝗛𝗔𝗥𝗧
bit ➡ 0 or 1
Byte ➡ 8 bits
Kilobyte ➡ 1024 Bytes
Megabyte ➡ 1024 KB
Gigabyte ➡ 1024 MB
Terabyte ➡ 1024 GB
Petabyte ➡ 1024 TB 𝗗𝗔𝗧𝗔 𝗢𝗖𝗖𝗨𝗣𝗔𝗧𝗜𝗢𝗡 𝗖𝗛𝗔𝗥𝗧
char –
int –
float –
और पढ़ें –
- बजट 2024 | Budget 2024 in Hindi
- Adhigam Ke Siddhant in Hindi | अधिगम के सिद्धांत | Easy Chart
- Uptet Psychology Notes in Hindi Pdf | सिद्धांत और उनके प्रतिपादक | direct pdf link
- BPSC TRE 3.0 | जल्द जारी होगा नोटफकेशन | Latest News
- ALL NOTES CLICK HERE प्राथमिक चिकित्सा एवं स्वास्थ्य (First Aid and Health)
- Best Study Methods for Exams
keyword
C Language Programming Programming C Language ProgrammingC Language Programming C Language Programming C Language Programming C Language Programming C Language Programming C Language ProgrammingC Language Programming C Language Programming C Language Programming C Language Programming C Language Programming C Language ProgrammingC Language Programming C Language Programming C Language Programming C Language Programming C Language Programming C Language ProgrammingC Language Programming C Language Programming C Language Programming
- UP SI Exam 2025: Syllabus, Pattern, Preparation Tips & Guide in Hindi | Good News
- UP SI Best 100 One-Liner Question & Answer
- मोदी भाषण 2025: लाल किले से स्वतंत्रता दिवस में बड़ा ऐलान | Big Updates
- कम समय में ज्यादा पढ़ाई कैसे करें – 10 Smart Study Tips (2025)
- भारत की शिक्षा प्रणाली की प्रमुख चुनौतियाँ और समाधान | 2025