C++ quik notes
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

PDF
Composite types
PDF
Pointers & functions
PPTX
Loops in R
PDF
11 2. variable-scope rule,-storage_class
PPT
Presentation mcrl2
PPTX
Storage classes in C
PPTX
PPTX
Storage classes in C
Composite types
Pointers & functions
Loops in R
11 2. variable-scope rule,-storage_class
Presentation mcrl2
Storage classes in C
Storage classes in C

What's hot (20)

PPTX
11 lec 11 storage class
PPTX
Storage class in c
PPT
Storage classes
PPTX
Typecasting in c
PPTX
Decision statements in c language
PPTX
Storage Class in C Progrmming
PPTX
Storage class
PPT
Type Casting in C++
PPT
Lecture 14 - Scope Rules
PPTX
Storage Classes and Functions
PPT
storage class
PPTX
Storage class in C Language
PPTX
Storage classes
PPT
STORAGE CLASSES
DOC
5.program structure
PPT
Lecture 13 - Storage Classes
PPT
Lecture06
PDF
Data structure scope of variables
PPT
Storage classes
PPSX
C lecture 4 nested loops and jumping statements slideshare
11 lec 11 storage class
Storage class in c
Storage classes
Typecasting in c
Decision statements in c language
Storage Class in C Progrmming
Storage class
Type Casting in C++
Lecture 14 - Scope Rules
Storage Classes and Functions
storage class
Storage class in C Language
Storage classes
STORAGE CLASSES
5.program structure
Lecture 13 - Storage Classes
Lecture06
Data structure scope of variables
Storage classes
C lecture 4 nested loops and jumping statements slideshare
Ad

Viewers also liked (20)

PPTX
#OOP_D_ITS - 8th - Class Diagram
PPTX
Storage Class Specifiers in C++
PPTX
Five components of communication
PPTX
class c++
PPSX
VISUAL BASIC .net i
PPSX
Php opps
PPSX
Application software
PPSX
Php basic
PPSX
Virus examples
PPSX
VISUAL BASIC .net v
PPSX
COMPUTER Tips ‘n’ Tricks
PPSX
Php oops1
PPSX
Java script
PPSX
PPSX
TALLY 1 st level entry
PPSX
TALLY Payroll ENTRY
PPSX
C programming file handling
PPSX
VISUAL BASIC .net iv
PPSX
VISUAL BASIC .net vi
PPSX
TALLY Pos ENTRY
#OOP_D_ITS - 8th - Class Diagram
Storage Class Specifiers in C++
Five components of communication
class c++
VISUAL BASIC .net i
Php opps
Application software
Php basic
Virus examples
VISUAL BASIC .net v
COMPUTER Tips ‘n’ Tricks
Php oops1
Java script
TALLY 1 st level entry
TALLY Payroll ENTRY
C programming file handling
VISUAL BASIC .net iv
VISUAL BASIC .net vi
TALLY Pos ENTRY
Ad

Similar to C++ quik notes (20)

DOCX
18 dec pointers and scope resolution operator
PDF
PPT2-C++ NUMERICAL METHOD FOR M.Sc PHYSICS
PDF
Introduction to C++
PDF
Static Keyword Static is a keyword in C++ used to give special chara.pdf
PPT
Pengaturcaraan asas
PPT
C++ Programming Course
PPT
Ccourse 140618093931-phpapp02
TXT
Advance C++notes
PDF
2.Types_Variables_Functions.pdf
PPT
Object Oriented Programming Examples with explanation
DOCX
New microsoft office word document (2)
PPTX
object oriented programming language.pptx
PPTX
C_plus_plus
PDF
Classes and object
PPT
02 functions, variables, basic input and output of c++
PPTX
CPP07 - Scope
PPT
C96e1 session3 c++
PPT
Lecture06-TypesVarsConsts variables data types
PPT
Lecture+06-TypesVars.ppt
PPTX
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
18 dec pointers and scope resolution operator
PPT2-C++ NUMERICAL METHOD FOR M.Sc PHYSICS
Introduction to C++
Static Keyword Static is a keyword in C++ used to give special chara.pdf
Pengaturcaraan asas
C++ Programming Course
Ccourse 140618093931-phpapp02
Advance C++notes
2.Types_Variables_Functions.pdf
Object Oriented Programming Examples with explanation
New microsoft office word document (2)
object oriented programming language.pptx
C_plus_plus
Classes and object
02 functions, variables, basic input and output of c++
CPP07 - Scope
C96e1 session3 c++
Lecture06-TypesVarsConsts variables data types
Lecture+06-TypesVars.ppt
Lecture # 1 - Introduction Revision - 1 OOPS.pptx

More from argusacademy (20)

PPSX
Css & dhtml
PPSX
Html table
PPSX
Html ordered & unordered list
PPSX
Html level ii
PPSX
Html frame
PPSX
Html forms
PPSX
Html creating page link or hyperlink
PPSX
Html basic
PPSX
Php string
PPSX
Php session
PPSX
Php if else
PPSX
Php creating forms
PPSX
Php create and invoke function
PPSX
Php array
PPSX
Sql query
PPSX
PDF
Oracle
PDF
Vb.net iv
PDF
Vb.net iii
PDF
Vb.net ii
Css & dhtml
Html table
Html ordered & unordered list
Html level ii
Html frame
Html forms
Html creating page link or hyperlink
Html basic
Php string
Php session
Php if else
Php creating forms
Php create and invoke function
Php array
Sql query
Oracle
Vb.net iv
Vb.net iii
Vb.net ii

Recently uploaded (20)

PPTX
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
African Communication Research: A review
PPTX
Climate Change and Its Global Impact.pptx
PDF
Nurlina - Urban Planner Portfolio (english ver)
PDF
Disorder of Endocrine system (1).pdfyyhyyyy
PPTX
CAPACITY BUILDING PROGRAMME IN ADOLESCENT EDUCATION
PDF
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
PPTX
Reproductive system-Human anatomy and physiology
PPTX
ACFE CERTIFICATION TRAINING ON LAW.pptx
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
fundamentals-of-heat-and-mass-transfer-6th-edition_incropera.pdf
PPTX
Thinking Routines and Learning Engagements.pptx
PDF
THE CHILD AND ADOLESCENT LEARNERS & LEARNING PRINCIPLES
PPTX
BSCE 2 NIGHT (CHAPTER 2) just cases.pptx
PDF
faiz-khans about Radiotherapy Physics-02.pdf
PDF
Laparoscopic Colorectal Surgery at WLH Hospital
PDF
Everyday Spelling and Grammar by Kathi Wyldeck
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PDF
Controlled Drug Delivery System-NDDS UNIT-1 B.Pharm 7th sem
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
Cambridge-Practice-Tests-for-IELTS-12.docx
African Communication Research: A review
Climate Change and Its Global Impact.pptx
Nurlina - Urban Planner Portfolio (english ver)
Disorder of Endocrine system (1).pdfyyhyyyy
CAPACITY BUILDING PROGRAMME IN ADOLESCENT EDUCATION
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
Reproductive system-Human anatomy and physiology
ACFE CERTIFICATION TRAINING ON LAW.pptx
Journal of Dental Science - UDMY (2021).pdf
fundamentals-of-heat-and-mass-transfer-6th-edition_incropera.pdf
Thinking Routines and Learning Engagements.pptx
THE CHILD AND ADOLESCENT LEARNERS & LEARNING PRINCIPLES
BSCE 2 NIGHT (CHAPTER 2) just cases.pptx
faiz-khans about Radiotherapy Physics-02.pdf
Laparoscopic Colorectal Surgery at WLH Hospital
Everyday Spelling and Grammar by Kathi Wyldeck
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
Controlled Drug Delivery System-NDDS UNIT-1 B.Pharm 7th sem

C++ quik notes

  • 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