SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Inline functions in C++
Presented by Harish Gyanani
Index (Questions answered in this ppt)
• What is inline function?
• Why use inline function?
• When to use inline function?
• How to make a normal function, inline?
• Inline is a request or command?
What is inline function?
• An inline function is a function that is
expanded in line when it is invoked.
• The compiler replaces the function call with
the corresponding function code.
• If a function is inline, the compiler places a
copy of the code of that function at each point
where the function is called at compile time.
Why use inline function?
To eliminate the cost of calls to small functions,
we use inline function.
When to use?
The functions are made inline when they are
small enough to be defined in one or two lines.
How to make a normal function inline?
It is easy to make a function inline. All we need
to do is to prefix the keyword inline to the
function definition. All inline functions must be
defined before they are called.
Inline is a request, not a command
The inline keyword merely sends a request, not
a command, to the compiler. The compiler may
ignore this request if the function definition is
too long or too complicated and the function as
a normal function.

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (18)

4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
 
inline function
inline functioninline function
inline function
 
Testing Live Server
Testing Live ServerTesting Live Server
Testing Live Server
 
API Publishers Series, Part 2: Increase Adoption of Your Public API
API Publishers Series, Part 2: Increase Adoption of Your Public APIAPI Publishers Series, Part 2: Increase Adoption of Your Public API
API Publishers Series, Part 2: Increase Adoption of Your Public API
 
An intuitive guide to combining free monad and free applicative
An intuitive guide to combining free monad and free applicativeAn intuitive guide to combining free monad and free applicative
An intuitive guide to combining free monad and free applicative
 
Postman 101 for developers
Postman 101 for developersPostman 101 for developers
Postman 101 for developers
 
API Testing
API TestingAPI Testing
API Testing
 
Data Driven API Testing: Best Practices for Real-World Testing Scenarios
Data Driven API Testing: Best Practices for Real-World Testing ScenariosData Driven API Testing: Best Practices for Real-World Testing Scenarios
Data Driven API Testing: Best Practices for Real-World Testing Scenarios
 
Huge: Running an API at Scale
Huge: Running an API at ScaleHuge: Running an API at Scale
Huge: Running an API at Scale
 
Functional Programming For All - Scala Matsuri 2016
Functional Programming For All - Scala Matsuri 2016Functional Programming For All - Scala Matsuri 2016
Functional Programming For All - Scala Matsuri 2016
 
Api testing and steps to do it
Api testing and steps to do itApi testing and steps to do it
Api testing and steps to do it
 
Pure functions and usage in Angular
Pure functions and usage in AngularPure functions and usage in Angular
Pure functions and usage in Angular
 
ONEs Q1 2019 - Human MT Evaluation At Scale
ONEs Q1 2019 - Human MT Evaluation At ScaleONEs Q1 2019 - Human MT Evaluation At Scale
ONEs Q1 2019 - Human MT Evaluation At Scale
 
Tdd for php
Tdd for phpTdd for php
Tdd for php
 
Testing APIs in the Cloud
Testing APIs in the CloudTesting APIs in the Cloud
Testing APIs in the Cloud
 
Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?
 
Building front-end apps that Scale - FOSDEM 2014
Building front-end apps that Scale - FOSDEM 2014Building front-end apps that Scale - FOSDEM 2014
Building front-end apps that Scale - FOSDEM 2014
 
Streamline business worksflows with azure durable functiox
Streamline business worksflows with azure durable functioxStreamline business worksflows with azure durable functiox
Streamline business worksflows with azure durable functiox
 

Andere mochten auch

Our Country India
Our Country IndiaOur Country India
Our Country India
guesta53677
 
Solar energy ppt
Solar energy pptSolar energy ppt
Solar energy ppt
shubhajit_b
 

Andere mochten auch (19)

Hardware concepts
Hardware conceptsHardware concepts
Hardware concepts
 
Abstract classes and Methods in java
Abstract classes and Methods in javaAbstract classes and Methods in java
Abstract classes and Methods in java
 
open source
open sourceopen source
open source
 
What's database normalization
What's database normalizationWhat's database normalization
What's database normalization
 
Simple class and object examples in java
Simple class and object examples in javaSimple class and object examples in java
Simple class and object examples in java
 
open source
open sourceopen source
open source
 
Corruption In India
Corruption In IndiaCorruption In India
Corruption In India
 
Incredible India
Incredible IndiaIncredible India
Incredible India
 
My country india
My country   indiaMy country   india
My country india
 
Our Country India
Our Country IndiaOur Country India
Our Country India
 
Corruption in india
Corruption in indiaCorruption in india
Corruption in india
 
Black Money in India.
Black Money in India.Black Money in India.
Black Money in India.
 
Black money ppt
Black money pptBlack money ppt
Black money ppt
 
INCREDIBLE INDIA
INCREDIBLE INDIAINCREDIBLE INDIA
INCREDIBLE INDIA
 
Corruption ppt
Corruption pptCorruption ppt
Corruption ppt
 
India PPT
India PPTIndia PPT
India PPT
 
Solar power.ppt
Solar power.pptSolar power.ppt
Solar power.ppt
 
Solar energy power point presentation
Solar energy power point presentation Solar energy power point presentation
Solar energy power point presentation
 
Solar energy ppt
Solar energy pptSolar energy ppt
Solar energy ppt
 

Ähnlich wie Inline functions in c++

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
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Jay Patel
 

Ähnlich wie Inline functions in c++ (20)

INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
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
 
Introduction to Functional Programming
Introduction to Functional ProgrammingIntroduction to Functional Programming
Introduction to Functional Programming
 
CPP11 - Function Design
CPP11 - Function DesignCPP11 - Function Design
CPP11 - Function Design
 
Inline functions
Inline functionsInline functions
Inline functions
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
 
Technical trainning.pptx
Technical trainning.pptxTechnical trainning.pptx
Technical trainning.pptx
 
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
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
 
CPP06 - Functions
CPP06 - FunctionsCPP06 - Functions
CPP06 - Functions
 
Python Functions
Python FunctionsPython Functions
Python Functions
 
apidays LIVE Helsinki & North - Ideas around automating API Management by Mat...
apidays LIVE Helsinki & North - Ideas around automating API Management by Mat...apidays LIVE Helsinki & North - Ideas around automating API Management by Mat...
apidays LIVE Helsinki & North - Ideas around automating API Management by Mat...
 
Basic c++
Basic c++Basic c++
Basic c++
 
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFunction Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
 
Why functional programming in C# & F#
Why functional programming in C# & F#Why functional programming in C# & F#
Why functional programming in C# & F#
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
 
Automation in Jira for beginners
Automation in Jira for beginnersAutomation in Jira for beginners
Automation in Jira for beginners
 
Functions in c
Functions in cFunctions in c
Functions in c
 
C- language Lecture 4
C- language Lecture 4C- language Lecture 4
C- language Lecture 4
 
inline function
inline function inline function
inline function
 

Kürzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Kürzlich hochgeladen (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Inline functions in c++

  • 1. Inline functions in C++ Presented by Harish Gyanani
  • 2. Index (Questions answered in this ppt) • What is inline function? • Why use inline function? • When to use inline function? • How to make a normal function, inline? • Inline is a request or command?
  • 3. What is inline function? • An inline function is a function that is expanded in line when it is invoked. • The compiler replaces the function call with the corresponding function code. • If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time.
  • 4. Why use inline function? To eliminate the cost of calls to small functions, we use inline function.
  • 5. When to use? The functions are made inline when they are small enough to be defined in one or two lines.
  • 6. How to make a normal function inline? It is easy to make a function inline. All we need to do is to prefix the keyword inline to the function definition. All inline functions must be defined before they are called.
  • 7. Inline is a request, not a command The inline keyword merely sends a request, not a command, to the compiler. The compiler may ignore this request if the function definition is too long or too complicated and the function as a normal function.