help4code-logo
  • eLearning
    • Tutorials
    • Programs
    • Interview Questions
    • Technical Questions
    • C Language
    • C++
    • JAVA
    • HTML & CSS
    • PHP
    • AJAX
    • J2EE
    • SQL
    • jQuery
  • Go back to Home
  • Our Placements
  • Tutorials
  • Programs
  • Interview Questions
  • Technical Questions
  • Live Training
  • Our Placements
  • Associated Colleges
  • Our Recruiters
  • Back
  • C Language
  • C++
  • JAVA
  • HTML & CSS
  • PHP
  • AJAX
  • J2EE
  • SQL
  • jQuery

Tutorials

  1. Home
  2. Tutorials
  3. C++
  4. Functions
Image

C++ - Functions - 4. Inline function

  • Topics
    • Introduction to C++
    • Variable
      • Declaring Variable
      • Dynamic initialization of variable
      • Reference Variable
      • Static or Static Local Variables
    • Datatypes
    • Operator
      • List Of Operator
      • Assignment Operator
      • Arithmetic Operator
      • Conditional Operator
    • Functions
      • Functions
      • 1. Call by value
      • 2. Call by address
      • 3. Call by reference
      • 4. Inline function
      • 5. Default argument function
      • 6. Function Overloading
    • Structure
    • Class
    • Object
      • Object
      • Defining member function within class
      • Object array
      • Object as function arguments
      • Object memory allocation
    • Constructor
    • Destructor
    • this pointer
      • this pointer
      • Static member
      • Static Member Function
    • Friend Function
    • Friend Class
    • Operator Overloading
    • Inheritance
      • Inheritance
      • 1. Single Inheritance
      • 2. Multilevel Inheritance
      • 3. Hierarchical Inheritance
      • 4. Multiple Inheritance
      • 5. Hybrid Inheritance
    • Function Overriding
    • Ambiguity in Multiple inheritance
    • Virtual Function
    • Pure Virtual Function
    • Templates

4. Inline function

Inline function is a new concept introduce by C++ language. It replace function body code at the place of function call. In the class functions are by default inline.

Syntax:
	inline return_type function_name(Parameters){

	}
e.g:
#include<iostream.h>
#include<conio.h>
int power(int,int);
void main()
{
 clrscr();
 cout<<"\nPower "<<power(2,3)<<" "<<power(4,5)<<" "<<power(3,3);
 getch();
}
inline int power(int x,int y)
{
 int sum=1;
  for(int i=1;i<=y;i++)
       sum*=x;
  return sum;
}
  • Previous
  • Next
  • Help4Code

    The help4code.com - An e-learning educational website where all computer science students can find rich collection of computer language programs which will help in exploring computer programming.

    • About
    • Associated Colleges
    • Leadership
    • Careers
    • Our Recruiters
    • Community
    • Terms
    • Privacy
    • Help
    • Press
    • Contact
    • Directory

    First Floor, Plot No. 4, Near Shat Ayu College, Ring Road Nagpur, Maharashtra, India - 440022
    +91 9175287066[email protected]

    © Copyright 2023 help4code.com.

    • My Account
    • Sign-in
    • Sign-up