C++ inline function


/ Published in: C++
Save to your folder(s)

basic demonstration in inline functions in c++


Copy this code and paste it in your HTML
  1. #include <iostream>
  2. // Vamsi
  3. // Code to show inline functions in c++
  4. using namespace std;
  5. inline float mul(float a, float b)
  6. {
  7. return (a*b);
  8. }
  9. inline float div(float a, float b)
  10. {
  11. return (a/b);
  12. }
  13. int main () {
  14. float a = 10;
  15. float b= 20;
  16. cout << mul(10,20) << endl ;
  17. cout << div(10,20) << endl ;
  18. return 0;
  19. }

URL: http://vamsii.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.