SlideShare a Scribd company logo
1 of 7
Sizeof:- time operator sizeof is a unray compile time 
operator that returns the length of variable or 
parenthesized type specifierthat it precedes. 
ex:- sizeof (type) [where type is c++ datatype] 
ex:- sizeof(int); 
The comma operator 
a pair of expressions separated by a comma is evaluated 
left to right. 
Z= (a=1, a+5) / * bracket evaluates 6 and thus is the value 
assigned to Z.
Type casting 
The process of converting one predefined type into another is called type casting. 
type conversion have two forms:- 
implicit type conversion 
explicit type conversion 
Implicit type conversion:- the process of converting one predefined type into 
another performed by compiler without programmer’s intervention. it is applied 
generally whenever different data types are intermixed in an expression. 
ex:- long double 
It either operand is of type long double the other is converted to long double. 
Explicit type conversion:- Explicit type conversion is user defined that forces an 
expression to be a specific type. 
ex:-void main () 
{ 
int x=65; 
cout<<x<<endl; 
cout<<(char)x; //explicit type casting 
} 
output:- 65 
A
C ++ shorthands 
C++ offers special shorthands that simplify the coading of certain type 
of assignment statements. 
ex:- a=a+10 
can be written as, 
a+ =10 
some examples of c++ shorthands:- 
X- =10 Equivalent 
to 
X= X-10; 
X*=3 Equivalent to X=X*3; 
X/=2 Equivalent to X=X/2 
X%=z Equivalent to X=X/Z
Properties of variable can be describe by two ways:- 
Data type 
Storage class specifier 
Complete declaration for variable:- 
Storage_ class_ specifier datatype variable name; 
FOUR TYPES OF STORAGE CLASS SPECIFIER:- 
Automatic (local to block) 
When variable are declared in the beginning of a block they are automatically 
created by assigning the memory. The values of such variable are garbage. 
Therefor they are also called automatic variable. All such variable gets destroyed 
whenever their scope ends. 
Eg:- 
void fun 
{ 
int a; /* local to fun block*/ 
} 
Void fun1 
{ 
int a; /* local to fun1 block*/ 
}
Static – a variable when declared static gets initialized by zero or by 
a specific value only for the first time at the time of declaration. Such 
variable retain their value throughout the life time of variable. 
void () 
{ 
int i, sum=0; //sum is declared as static variable 
for (i= 0; i<=10; i++) 
{ 
sum= sum +i; 
} 
cout<<”nSum is =”<<sum; 
} 
Extern:- variable when defined outside the program file but used in 
the current file are used after linked them using extern keyword in 
declaration. 
Register:- its concept is in low level programming language there is 
no any use in high level language.
Global ( outside all scope) 
When variable is declared outside of all scope as it is visible 
throughout the main program and its associated function with 
specific value are initialized by zero , 
int a ; /* global variable*/ 
void main () 
{ } 
Scope resolution operator(::) - When name of local and global 
variable is same then to distinguish between these two variables 
we use scope resolution operator it denotes global variable only. 
Ex:- 
int a = 10 ; /* global variable*/ 
void main () 
{ 
int a = 100; /*local variable */ 
cout<<”a = ”<<a<<” “<<”::a =”<<::a; 
} 
Output:-a = 100 ::a = 10

More Related Content

What's hot

11 lec 11 storage class
11 lec 11 storage class11 lec 11 storage class
11 lec 11 storage classkapil078
 
Storage class in c
Storage class in cStorage class in c
Storage class in ckash95
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c languagetanmaymodi4
 
Storage Class in C Progrmming
Storage Class in C Progrmming Storage Class in C Progrmming
Storage Class in C Progrmming Kamal Acharya
 
Storage Classes and Functions
Storage Classes and FunctionsStorage Classes and Functions
Storage Classes and FunctionsJake Bond
 
storage class
storage classstorage class
storage classstudent
 
Data structure scope of variables
Data structure scope of variablesData structure scope of variables
Data structure scope of variablesSaurav Kumar
 
C lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshareC lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshareGagan Deep
 

What's hot (20)

11 lec 11 storage class
11 lec 11 storage class11 lec 11 storage class
11 lec 11 storage class
 
Storage class in c
Storage class in cStorage class in c
Storage class in c
 
Storage classes
Storage classesStorage classes
Storage classes
 
Typecasting in c
Typecasting in cTypecasting in c
Typecasting in c
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
 
Storage Class in C Progrmming
Storage Class in C Progrmming Storage Class in C Progrmming
Storage Class in C Progrmming
 
Storage class
Storage classStorage class
Storage class
 
Type Casting in C++
Type Casting in C++Type Casting in C++
Type Casting in C++
 
Lecture 14 - Scope Rules
Lecture 14 - Scope RulesLecture 14 - Scope Rules
Lecture 14 - Scope Rules
 
Storage Classes and Functions
Storage Classes and FunctionsStorage Classes and Functions
Storage Classes and Functions
 
storage class
storage classstorage class
storage class
 
Storage class in C Language
Storage class in C LanguageStorage class in C Language
Storage class in C Language
 
Storage classes
Storage classesStorage classes
Storage classes
 
STORAGE CLASSES
STORAGE CLASSESSTORAGE CLASSES
STORAGE CLASSES
 
5.program structure
5.program structure5.program structure
5.program structure
 
Lecture 13 - Storage Classes
Lecture 13 - Storage ClassesLecture 13 - Storage Classes
Lecture 13 - Storage Classes
 
Lecture06
Lecture06Lecture06
Lecture06
 
Data structure scope of variables
Data structure scope of variablesData structure scope of variables
Data structure scope of variables
 
Storage classes
Storage classesStorage classes
Storage classes
 
C lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshareC lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshare
 

Viewers also liked

#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class Diagram#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class DiagramHadziq Fabroyir
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++Reddhi Basu
 
Five components of communication
Five components of communicationFive components of communication
Five components of communicationjumar dimas
 
VISUAL BASIC .net i
VISUAL BASIC .net iVISUAL BASIC .net i
VISUAL BASIC .net iargusacademy
 
Application software
Application softwareApplication software
Application softwareargusacademy
 
VISUAL BASIC .net v
VISUAL BASIC .net vVISUAL BASIC .net v
VISUAL BASIC .net vargusacademy
 
COMPUTER Tips ‘n’ Tricks
COMPUTER Tips ‘n’   TricksCOMPUTER Tips ‘n’   Tricks
COMPUTER Tips ‘n’ Tricksargusacademy
 
TALLY 1 st level entry
TALLY 1 st level entryTALLY 1 st level entry
TALLY 1 st level entryargusacademy
 
TALLY Payroll ENTRY
TALLY Payroll ENTRYTALLY Payroll ENTRY
TALLY Payroll ENTRYargusacademy
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handlingargusacademy
 
VISUAL BASIC .net iv
VISUAL BASIC .net ivVISUAL BASIC .net iv
VISUAL BASIC .net ivargusacademy
 
VISUAL BASIC .net vi
VISUAL BASIC .net viVISUAL BASIC .net vi
VISUAL BASIC .net viargusacademy
 

Viewers also liked (20)

#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class Diagram#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class Diagram
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++
 
Five components of communication
Five components of communicationFive components of communication
Five components of communication
 
class c++
class c++class c++
class c++
 
VISUAL BASIC .net i
VISUAL BASIC .net iVISUAL BASIC .net i
VISUAL BASIC .net i
 
Php opps
Php oppsPhp opps
Php opps
 
Application software
Application softwareApplication software
Application software
 
Php basic
Php basicPhp basic
Php basic
 
Virus examples
Virus examplesVirus examples
Virus examples
 
VISUAL BASIC .net v
VISUAL BASIC .net vVISUAL BASIC .net v
VISUAL BASIC .net v
 
COMPUTER Tips ‘n’ Tricks
COMPUTER Tips ‘n’   TricksCOMPUTER Tips ‘n’   Tricks
COMPUTER Tips ‘n’ Tricks
 
Php oops1
Php oops1Php oops1
Php oops1
 
Java script
Java scriptJava script
Java script
 
Paint
PaintPaint
Paint
 
TALLY 1 st level entry
TALLY 1 st level entryTALLY 1 st level entry
TALLY 1 st level entry
 
TALLY Payroll ENTRY
TALLY Payroll ENTRYTALLY Payroll ENTRY
TALLY Payroll ENTRY
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handling
 
VISUAL BASIC .net iv
VISUAL BASIC .net ivVISUAL BASIC .net iv
VISUAL BASIC .net iv
 
VISUAL BASIC .net vi
VISUAL BASIC .net viVISUAL BASIC .net vi
VISUAL BASIC .net vi
 
TALLY Pos ENTRY
TALLY Pos ENTRYTALLY Pos ENTRY
TALLY Pos ENTRY
 

Similar to C++ quik notes

What is storage class
What is storage classWhat is storage class
What is storage classIsha Aggarwal
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cppsharvivek
 
Storage classes arrays & functions in C Language
Storage classes arrays & functions in C LanguageStorage classes arrays & functions in C Language
Storage classes arrays & functions in C LanguageJenish Bhavsar
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentalsumar78600
 
Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and AnswersDaisyWatson5
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYRajeshkumar Reddy
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of VariableMOHIT DADU
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++Manzoor ALam
 
Cs1123 4 variables_constants
Cs1123 4 variables_constantsCs1123 4 variables_constants
Cs1123 4 variables_constantsTAlha MAlik
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 FunctionDeepak Singh
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semKavita Dagar
 
Microcontroller lec 3
Microcontroller  lec 3Microcontroller  lec 3
Microcontroller lec 3Ibrahim Reda
 
Ch-4-Operator Overloading.pdf
Ch-4-Operator Overloading.pdfCh-4-Operator Overloading.pdf
Ch-4-Operator Overloading.pdfesuEthopi
 
C language presentation
C language presentationC language presentation
C language presentationbainspreet
 
Oop lect3.pptx
Oop lect3.pptxOop lect3.pptx
Oop lect3.pptxMrMudassir
 

Similar to C++ quik notes (20)

What is storage class
What is storage classWhat is storage class
What is storage class
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
 
What is c
What is cWhat is c
What is c
 
Storage classes arrays & functions in C Language
Storage classes arrays & functions in C LanguageStorage classes arrays & functions in C Language
Storage classes arrays & functions in C Language
 
Function in C++
Function in C++Function in C++
Function in C++
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
C functions list
C functions listC functions list
C functions list
 
Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and Answers
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of Variable
 
functions
functionsfunctions
functions
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++
 
Cs1123 4 variables_constants
Cs1123 4 variables_constantsCs1123 4 variables_constants
Cs1123 4 variables_constants
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 Function
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
Microcontroller lec 3
Microcontroller  lec 3Microcontroller  lec 3
Microcontroller lec 3
 
Ch-4-Operator Overloading.pdf
Ch-4-Operator Overloading.pdfCh-4-Operator Overloading.pdf
Ch-4-Operator Overloading.pdf
 
C language presentation
C language presentationC language presentation
C language presentation
 
Oop lect3.pptx
Oop lect3.pptxOop lect3.pptx
Oop lect3.pptx
 

More from argusacademy (20)

Css & dhtml
Css  & dhtmlCss  & dhtml
Css & dhtml
 
Html table
Html tableHtml table
Html table
 
Html ordered & unordered list
Html ordered & unordered listHtml ordered & unordered list
Html ordered & unordered list
 
Html level ii
Html level  iiHtml level  ii
Html level ii
 
Html frame
Html frameHtml frame
Html frame
 
Html forms
Html formsHtml forms
Html forms
 
Html creating page link or hyperlink
Html creating page link or hyperlinkHtml creating page link or hyperlink
Html creating page link or hyperlink
 
Html basic
Html basicHtml basic
Html basic
 
Php string
Php stringPhp string
Php string
 
Php session
Php sessionPhp session
Php session
 
Php if else
Php if elsePhp if else
Php if else
 
Php creating forms
Php creating formsPhp creating forms
Php creating forms
 
Php create and invoke function
Php create and invoke functionPhp create and invoke function
Php create and invoke function
 
Php array
Php arrayPhp array
Php array
 
Sql query
Sql querySql query
Sql query
 
Rdbms
RdbmsRdbms
Rdbms
 
Oracle
OracleOracle
Oracle
 
Vb.net iv
Vb.net ivVb.net iv
Vb.net iv
 
Vb.net iii
Vb.net iiiVb.net iii
Vb.net iii
 
Vb.net ii
Vb.net iiVb.net ii
Vb.net ii
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

C++ quik notes

  • 1.
  • 2. Sizeof:- time operator sizeof is a unray compile time operator that returns the length of variable or parenthesized type specifierthat it precedes. ex:- sizeof (type) [where type is c++ datatype] ex:- sizeof(int); The comma operator a pair of expressions separated by a comma is evaluated left to right. Z= (a=1, a+5) / * bracket evaluates 6 and thus is the value assigned to Z.
  • 3. Type casting The process of converting one predefined type into another is called type casting. type conversion have two forms:- implicit type conversion explicit type conversion Implicit type conversion:- the process of converting one predefined type into another performed by compiler without programmer’s intervention. it is applied generally whenever different data types are intermixed in an expression. ex:- long double It either operand is of type long double the other is converted to long double. Explicit type conversion:- Explicit type conversion is user defined that forces an expression to be a specific type. ex:-void main () { int x=65; cout<<x<<endl; cout<<(char)x; //explicit type casting } output:- 65 A
  • 4. C ++ shorthands C++ offers special shorthands that simplify the coading of certain type of assignment statements. ex:- a=a+10 can be written as, a+ =10 some examples of c++ shorthands:- X- =10 Equivalent to X= X-10; X*=3 Equivalent to X=X*3; X/=2 Equivalent to X=X/2 X%=z Equivalent to X=X/Z
  • 5. Properties of variable can be describe by two ways:- Data type Storage class specifier Complete declaration for variable:- Storage_ class_ specifier datatype variable name; FOUR TYPES OF STORAGE CLASS SPECIFIER:- Automatic (local to block) When variable are declared in the beginning of a block they are automatically created by assigning the memory. The values of such variable are garbage. Therefor they are also called automatic variable. All such variable gets destroyed whenever their scope ends. Eg:- void fun { int a; /* local to fun block*/ } Void fun1 { int a; /* local to fun1 block*/ }
  • 6. Static – a variable when declared static gets initialized by zero or by a specific value only for the first time at the time of declaration. Such variable retain their value throughout the life time of variable. void () { int i, sum=0; //sum is declared as static variable for (i= 0; i<=10; i++) { sum= sum +i; } cout<<”nSum is =”<<sum; } Extern:- variable when defined outside the program file but used in the current file are used after linked them using extern keyword in declaration. Register:- its concept is in low level programming language there is no any use in high level language.
  • 7. Global ( outside all scope) When variable is declared outside of all scope as it is visible throughout the main program and its associated function with specific value are initialized by zero , int a ; /* global variable*/ void main () { } Scope resolution operator(::) - When name of local and global variable is same then to distinguish between these two variables we use scope resolution operator it denotes global variable only. Ex:- int a = 10 ; /* global variable*/ void main () { int a = 100; /*local variable */ cout<<”a = ”<<a<<” “<<”::a =”<<::a; } Output:-a = 100 ::a = 10