Posted By

vamsi on 01/05/11


Tagged

inline


Versions (?)

C++ inline function


 / Published in: C++
 

URL: http://vamsii.com

basic demonstration in inline functions in c++

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

Report this snippet  

You need to login to post a comment.