Search
 
SCRIPT & CODE EXAMPLE
 

CPP

inline function in c++

#include <iostream>
using namespace std;


//this function is the fastest bacause it executes at compile time and is really fast , 
//but dont use it for like a big function  
inline int cube(int s)
{
    return s*s*s;
}
int main()
{
    cout << "The cube of 3 is: " << cube(3) << "
";
    return 0;
} //Output: The cube of 3 is: 27
Comment

inline function in cpp

inline <return_type> <function_name>(<parameters>)
{
    // function code
}

SOURCE - geeksforgeeks
Comment

PREVIOUS NEXT
Code Example
Cpp :: c ++ program to insert into hashmap 
Cpp :: balanced brackets in c++ 
Cpp :: how to extract a folder using python 
Cpp :: assignment operator with pointers c++ 
Cpp :: backtrack 
Cpp :: c++ write to file in directory 
Cpp :: clear map in C++ 
Cpp :: get function in cpp. 
Cpp :: __builtin_popcount long long 
Cpp :: split string in c++ 
Cpp :: c++ program to find gcd of 3 numbers 
Cpp :: count c++ 
Cpp :: Basic Makefile C++ 
Cpp :: 1. Two Sum 
Cpp :: cpp substring 
Cpp :: how to set arrays as function parameters in c++ 
Cpp :: calling by reference c++ 
Cpp :: map of maps c++ 
Cpp :: bit masking tricks 
Cpp :: C++ file . 
Cpp :: pointers in cpp 
Cpp :: uint16_t in c++ 
Cpp :: Minimizing the dot product codechef in c++ 
Cpp :: c++ optimize big int array 
Cpp :: cpp module 42 
Cpp :: is obje file binary?? 
Cpp :: big o notation practice c++ 
Cpp :: library management system project in c++ using array 
Cpp :: c++ sort numbers by magnitude/absolute value 
Cpp :: C++ singleton prevent copy 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =