Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- template<class T>
- T retornar_valores(T x ){
- return x;
- }
- // podemos retorna cualquier tipos de valores
- // sin necesidad de escribir y copiar la funcion
- /* otra vez A esto se le llama plantilla
- Esto nos ahorra este codigos :
- int retornar_valores(int x){return x;}
- string retornar_valores(string nombre){return nombre;}
- */
- int main(){
- cout << retornar_valores('a') <<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement