SlideShare a Scribd company logo
2
How to declare the inline function in the program? 
inline <prototype> <function name>(argument 1,argument 2) 
inline void sum( int a , int b)
Most read
5
EG 
#include<conio.h> 
#include<iostream.h> 
class loop 
{ 
int a; 
public: 
inline void even(); 
}; 
void loop ::even(int aa) 
{ 
a= aa; 
for(int i =1; i<=a; i++) 
{ 
if(i%2==0) 
{ 
printf(“nn %d”,i); 
} 
} 
}
Most read
6
void main() 
{ 
int a; 
clrscr(); 
printf(“nn Please enter the number : ”); 
scanf(“%d”,&a); 
loop l1; 
l1.even(a); 
getch(); 
}
Most read
What is Inline Function in C++ 
• Inline Function is a Inbuilt Function in C++ . 
• Those function which are declared inside the class are automatically 
defined as INLINE. 
• The function which are static means the values of the variables inside 
the function are not dynamic only those function will be accepted by 
inline function else the warning will be occurred by the C compiler.. 
• Eg. Looping statement are not considered in the Inline Function…
How to declare the inline function in the program? 
inline <prototype> <function name>(argument 1,argument 2) 
inline void sum( int a , int b)
Advantages…. 
• The compiler makes a copy of the function defined as the inline so that 
The compilation time is reduced as the compiler does not have to 
recompile that part of the code. 
• Due to this the static values are only be favorable to the rules of the 
inline function 
• If the function contains looping statement means the values are not fixed 
because up to which values loop will continue. 
• Thus if the operation or function is of adding of 2 values are appropriate for 
the inline function because here the values of variables are dynamic but the 
operation is only same i.e. SUM(+)
Inline function warning in C++ 
• As I stated above compiler gives warning when you insert any 
looping statement in the inline function. 
Warning: 
FUNCTION CONTAINING FOR ARE NOT EXPANDED INLINE 
Solving this warning… 
• The solution is just declare the function outside the class.. Using the scope resolution 
operator. (::)
EG 
#include<conio.h> 
#include<iostream.h> 
class loop 
{ 
int a; 
public: 
inline void even(); 
}; 
void loop ::even(int aa) 
{ 
a= aa; 
for(int i =1; i<=a; i++) 
{ 
if(i%2==0) 
{ 
printf(“nn %d”,i); 
} 
} 
}
void main() 
{ 
int a; 
clrscr(); 
printf(“nn Please enter the number : ”); 
scanf(“%d”,&a); 
loop l1; 
l1.even(a); 
getch(); 
}

More Related Content

What's hot (20)

Java package
Java packageJava package
Java package
CS_GDRCST
 
Friend function
Friend functionFriend function
Friend function
zindadili
 
array of object pointer in c++
array of object pointer in c++array of object pointer in c++
array of object pointer in c++
Arpita Patel
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
This pointer
This pointerThis pointer
This pointer
Kamal Acharya
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
Muhammad Hammad Waseem
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
Dr Sukhpal Singh Gill
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
Kamal Acharya
 
Packages
PackagesPackages
Packages
Monika Mishra
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
03062679929
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
CPD INDIA
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
Vardhil Patel
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
Kumar
 
Looping Statements and Control Statements in Python
Looping Statements and Control Statements in PythonLooping Statements and Control Statements in Python
Looping Statements and Control Statements in Python
PriyankaC44
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
Monika Mishra
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
BHUVIJAYAVELU
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
Prof. Dr. K. Adisesha
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
moazamali28
 
Java package
Java packageJava package
Java package
CS_GDRCST
 
Friend function
Friend functionFriend function
Friend function
zindadili
 
array of object pointer in c++
array of object pointer in c++array of object pointer in c++
array of object pointer in c++
Arpita Patel
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
Muhammad Hammad Waseem
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
03062679929
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
CPD INDIA
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
Vardhil Patel
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
Kumar
 
Looping Statements and Control Statements in Python
Looping Statements and Control Statements in PythonLooping Statements and Control Statements in Python
Looping Statements and Control Statements in Python
PriyankaC44
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
Monika Mishra
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
BHUVIJAYAVELU
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
moazamali28
 

Viewers also liked (20)

Inline function
Inline functionInline function
Inline function
Tech_MX
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
Learn By Watch
 
Debugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsDebugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template Metaprograms
Platonov Sergey
 
C++ programming function
C++ programming functionC++ programming function
C++ programming function
Vishalini Mugunen
 
C++ Function
C++ FunctionC++ Function
C++ Function
Hajar
 
Functions
FunctionsFunctions
Functions
Kamal Acharya
 
02. functions & introduction to class
02. functions & introduction to class02. functions & introduction to class
02. functions & introduction to class
Haresh Jaiswal
 
C++ polymorphism
C++ polymorphismC++ polymorphism
C++ polymorphism
Ganesh Hogade
 
Matrix transapose in c++
Matrix transapose in c++Matrix transapose in c++
Matrix transapose in c++
imran khan
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Jay Patel
 
Chapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-classChapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-class
Deepak Singh
 
Inline Functions and Default arguments
Inline Functions and Default argumentsInline Functions and Default arguments
Inline Functions and Default arguments
Nikhil Pandit
 
Inheritance
InheritanceInheritance
Inheritance
Aadhi Aadhithya
 
Inheritance : Extending Classes
Inheritance : Extending ClassesInheritance : Extending Classes
Inheritance : Extending Classes
Nilesh Dalvi
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++
Aabha Tiwari
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
rprajat007
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
Ritika Sharma
 
Friend functions
Friend functions Friend functions
Friend functions
Megha Singh
 
polymorphism
polymorphism polymorphism
polymorphism
Imtiaz Hussain
 
Inline function
Inline functionInline function
Inline function
Tech_MX
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
Learn By Watch
 
Debugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsDebugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template Metaprograms
Platonov Sergey
 
C++ Function
C++ FunctionC++ Function
C++ Function
Hajar
 
02. functions & introduction to class
02. functions & introduction to class02. functions & introduction to class
02. functions & introduction to class
Haresh Jaiswal
 
Matrix transapose in c++
Matrix transapose in c++Matrix transapose in c++
Matrix transapose in c++
imran khan
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Jay Patel
 
Chapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-classChapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-class
Deepak Singh
 
Inline Functions and Default arguments
Inline Functions and Default argumentsInline Functions and Default arguments
Inline Functions and Default arguments
Nikhil Pandit
 
Inheritance : Extending Classes
Inheritance : Extending ClassesInheritance : Extending Classes
Inheritance : Extending Classes
Nilesh Dalvi
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++
Aabha Tiwari
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
rprajat007
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
Ritika Sharma
 
Friend functions
Friend functions Friend functions
Friend functions
Megha Singh
 
Ad

Similar to Inline function in C++ (20)

Function in C++, Methods in C++ coding programming
Function in C++, Methods in C++ coding programmingFunction in C++, Methods in C++ coding programming
Function in C++, Methods in C++ coding programming
estorebackupr
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
Venkateswarlu Vuggam
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
Venkateswarlu Vuggam
 
OOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptxOOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptx
sarthakgithub
 
Functions and structure in programming c
Functions and structure in programming cFunctions and structure in programming c
Functions and structure in programming c
dalalbhargavi19
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
Bharath904863
 
Funtions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the topsFuntions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the tops
sameermhr345
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
Vraj Patel
 
85ec7 session2 c++
85ec7 session2 c++85ec7 session2 c++
85ec7 session2 c++
Mukund Trivedi
 
Chapter 6 - Modular Programming- in C++.pptx
Chapter 6 - Modular Programming- in C++.pptxChapter 6 - Modular Programming- in C++.pptx
Chapter 6 - Modular Programming- in C++.pptx
ChereLemma2
 
Chapter 5 - Modular Programming.pdf
Chapter 5 - Modular Programming.pdfChapter 5 - Modular Programming.pdf
Chapter 5 - Modular Programming.pdf
KirubelWondwoson1
 
Programming in C Functions PPT Presentation.pdf
Programming in C Functions PPT Presentation.pdfProgramming in C Functions PPT Presentation.pdf
Programming in C Functions PPT Presentation.pdf
Ramesh Wadawadagi
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
Praveen M Jigajinni
 
structured Programming Unit-7-Functions.pptx
structured Programming Unit-7-Functions.pptxstructured Programming Unit-7-Functions.pptx
structured Programming Unit-7-Functions.pptx
SuryaBasnet1
 
Functions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvd
Functions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvdFunctions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvd
Functions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvd
scs150831
 
Function
FunctionFunction
Function
Rajat Patel
 
Function different types of funtion
Function different types of funtionFunction different types of funtion
Function different types of funtion
svishalsingh01
 
Chp8_C++_Functions_Part2_User-defined functions.pptx
Chp8_C++_Functions_Part2_User-defined functions.pptxChp8_C++_Functions_Part2_User-defined functions.pptx
Chp8_C++_Functions_Part2_User-defined functions.pptx
ssuser10ed71
 
Learning C++ - Functions in C++ 3
Learning C++ - Functions  in C++ 3Learning C++ - Functions  in C++ 3
Learning C++ - Functions in C++ 3
Ali Aminian
 
C++
C++C++
C++
MuhammadSaad281
 
Function in C++, Methods in C++ coding programming
Function in C++, Methods in C++ coding programmingFunction in C++, Methods in C++ coding programming
Function in C++, Methods in C++ coding programming
estorebackupr
 
OOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptxOOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptx
sarthakgithub
 
Functions and structure in programming c
Functions and structure in programming cFunctions and structure in programming c
Functions and structure in programming c
dalalbhargavi19
 
Funtions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the topsFuntions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the tops
sameermhr345
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
Vraj Patel
 
Chapter 6 - Modular Programming- in C++.pptx
Chapter 6 - Modular Programming- in C++.pptxChapter 6 - Modular Programming- in C++.pptx
Chapter 6 - Modular Programming- in C++.pptx
ChereLemma2
 
Chapter 5 - Modular Programming.pdf
Chapter 5 - Modular Programming.pdfChapter 5 - Modular Programming.pdf
Chapter 5 - Modular Programming.pdf
KirubelWondwoson1
 
Programming in C Functions PPT Presentation.pdf
Programming in C Functions PPT Presentation.pdfProgramming in C Functions PPT Presentation.pdf
Programming in C Functions PPT Presentation.pdf
Ramesh Wadawadagi
 
structured Programming Unit-7-Functions.pptx
structured Programming Unit-7-Functions.pptxstructured Programming Unit-7-Functions.pptx
structured Programming Unit-7-Functions.pptx
SuryaBasnet1
 
Functions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvd
Functions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvdFunctions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvd
Functions in C-csvsvvcvxcvxvxcvxcvvsvsvsfvsfvd
scs150831
 
Function different types of funtion
Function different types of funtionFunction different types of funtion
Function different types of funtion
svishalsingh01
 
Chp8_C++_Functions_Part2_User-defined functions.pptx
Chp8_C++_Functions_Part2_User-defined functions.pptxChp8_C++_Functions_Part2_User-defined functions.pptx
Chp8_C++_Functions_Part2_User-defined functions.pptx
ssuser10ed71
 
Learning C++ - Functions in C++ 3
Learning C++ - Functions  in C++ 3Learning C++ - Functions  in C++ 3
Learning C++ - Functions in C++ 3
Ali Aminian
 
Ad

Recently uploaded (20)

How a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdf
How a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdfHow a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdf
How a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdf
mary rojas
 
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjaraswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
muhammadalikhanalikh1
 
SQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptxSQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptx
Ashlei5
 
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATIONAI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
miso_uam
 
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
gauravvmanchandaa200
 
Facility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS SoftwareFacility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS Software
TeroTAM
 
Micro-Metrics Every Performance Engineer Should Validate Before Sign-Off
Micro-Metrics Every Performance Engineer Should Validate Before Sign-OffMicro-Metrics Every Performance Engineer Should Validate Before Sign-Off
Micro-Metrics Every Performance Engineer Should Validate Before Sign-Off
Tier1 app
 
Online Queue Management System for Public Service Offices [Focused on Municip...
Online Queue Management System for Public Service Offices [Focused on Municip...Online Queue Management System for Public Service Offices [Focused on Municip...
Online Queue Management System for Public Service Offices [Focused on Municip...
Rishab Acharya
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Boost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for SchoolsBoost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for Schools
Visitu
 
grade 9 ai project cycle Artificial intelligence.pptx
grade 9 ai project cycle Artificial intelligence.pptxgrade 9 ai project cycle Artificial intelligence.pptx
grade 9 ai project cycle Artificial intelligence.pptx
manikumar465287
 
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdfSecure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Northwind Technologies
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
Marketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptxMarketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptx
julia smits
 
Internship in South western railways on software
Internship in South western railways on softwareInternship in South western railways on software
Internship in South western railways on software
abhim5889
 
The rise of e-commerce has redefined how retailers operate—and reconciliation...
The rise of e-commerce has redefined how retailers operate—and reconciliation...The rise of e-commerce has redefined how retailers operate—and reconciliation...
The rise of e-commerce has redefined how retailers operate—and reconciliation...
Prachi Desai
 
AI Alternative - Discover the best AI tools and their alternatives
AI Alternative - Discover the best AI tools and their alternativesAI Alternative - Discover the best AI tools and their alternatives
AI Alternative - Discover the best AI tools and their alternatives
AI Alternative
 
Top 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdfTop 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdf
LL Technolab
 
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROIAutoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Udit Goenka
 
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Prachi Desai
 
How a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdf
How a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdfHow a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdf
How a Staff Augmentation Company IN USA Powers Flutter App Breakthroughs.pdf
mary rojas
 
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjaraswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
muhammadalikhanalikh1
 
SQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptxSQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptx
Ashlei5
 
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATIONAI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
miso_uam
 
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
gauravvmanchandaa200
 
Facility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS SoftwareFacility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS Software
TeroTAM
 
Micro-Metrics Every Performance Engineer Should Validate Before Sign-Off
Micro-Metrics Every Performance Engineer Should Validate Before Sign-OffMicro-Metrics Every Performance Engineer Should Validate Before Sign-Off
Micro-Metrics Every Performance Engineer Should Validate Before Sign-Off
Tier1 app
 
Online Queue Management System for Public Service Offices [Focused on Municip...
Online Queue Management System for Public Service Offices [Focused on Municip...Online Queue Management System for Public Service Offices [Focused on Municip...
Online Queue Management System for Public Service Offices [Focused on Municip...
Rishab Acharya
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Boost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for SchoolsBoost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for Schools
Visitu
 
grade 9 ai project cycle Artificial intelligence.pptx
grade 9 ai project cycle Artificial intelligence.pptxgrade 9 ai project cycle Artificial intelligence.pptx
grade 9 ai project cycle Artificial intelligence.pptx
manikumar465287
 
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdfSecure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Northwind Technologies
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
Marketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptxMarketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptx
julia smits
 
Internship in South western railways on software
Internship in South western railways on softwareInternship in South western railways on software
Internship in South western railways on software
abhim5889
 
The rise of e-commerce has redefined how retailers operate—and reconciliation...
The rise of e-commerce has redefined how retailers operate—and reconciliation...The rise of e-commerce has redefined how retailers operate—and reconciliation...
The rise of e-commerce has redefined how retailers operate—and reconciliation...
Prachi Desai
 
AI Alternative - Discover the best AI tools and their alternatives
AI Alternative - Discover the best AI tools and their alternativesAI Alternative - Discover the best AI tools and their alternatives
AI Alternative - Discover the best AI tools and their alternatives
AI Alternative
 
Top 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdfTop 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdf
LL Technolab
 
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROIAutoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Udit Goenka
 
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Prachi Desai
 

Inline function in C++

  • 1. What is Inline Function in C++ • Inline Function is a Inbuilt Function in C++ . • Those function which are declared inside the class are automatically defined as INLINE. • The function which are static means the values of the variables inside the function are not dynamic only those function will be accepted by inline function else the warning will be occurred by the C compiler.. • Eg. Looping statement are not considered in the Inline Function…
  • 2. How to declare the inline function in the program? inline <prototype> <function name>(argument 1,argument 2) inline void sum( int a , int b)
  • 3. Advantages…. • The compiler makes a copy of the function defined as the inline so that The compilation time is reduced as the compiler does not have to recompile that part of the code. • Due to this the static values are only be favorable to the rules of the inline function • If the function contains looping statement means the values are not fixed because up to which values loop will continue. • Thus if the operation or function is of adding of 2 values are appropriate for the inline function because here the values of variables are dynamic but the operation is only same i.e. SUM(+)
  • 4. Inline function warning in C++ • As I stated above compiler gives warning when you insert any looping statement in the inline function. Warning: FUNCTION CONTAINING FOR ARE NOT EXPANDED INLINE Solving this warning… • The solution is just declare the function outside the class.. Using the scope resolution operator. (::)
  • 5. EG #include<conio.h> #include<iostream.h> class loop { int a; public: inline void even(); }; void loop ::even(int aa) { a= aa; for(int i =1; i<=a; i++) { if(i%2==0) { printf(“nn %d”,i); } } }
  • 6. void main() { int a; clrscr(); printf(“nn Please enter the number : ”); scanf(“%d”,&a); loop l1; l1.even(a); getch(); }