Inline functions in c++
Upcoming SlideShare
Loading in...5
×
 

Inline functions in c++

on

  • 62 views

Inline functions in c++ ...

Inline functions in c++
Index-
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?

Statistics

Views

Total Views
62
Views on SlideShare
62
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Inline functions in c++ Inline functions in c++ Presentation Transcript

  • 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.