Advertisement
Jambix64

Funcao Sobrecarrega

Jul 14th, 2016
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  using namespace std;
  4.  
  5.   //Funcoes Sobrecarregados nome conhecido como Overhead
  6.   // Argumentos padrão para uma função;
  7.   int soma(int x = 0); // Pre definida
  8.  
  9.   int soma  (double);
  10.  
  11.   int main(){
  12.  
  13.   cout<<soma(1.5)<<endl;
  14.   cout<<soma(10)<<endl;
  15.  
  16.   system("pause");
  17.   return 0;
  18.  
  19.   }
  20.  
  21. int soma(int x){return x+x;}
  22.  
  23. int soma(double z){return z+z;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement