C Language Programming | Definition | History | Coding Trick

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 –


 

เค”เคฐ เคชเฅเฅ‡เค‚ โ€“

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ย 

ย 

 

Leave a Comment