Commit 2db64cfd authored by Samuel Oliveira's avatar Samuel Oliveira

Exemplo printArray adicionado na aula 5

parent b2226501
#include <iostream>
using namespace std;
template <class X> void printArray(X *array, int size){
for(int i = 0; i < size; i++){
cout << array[i] << endl;
}
}
int main(){
int vet1[5] = {1,2,3,4,5};
double vet2[5] = {1.1,2.2,3.3,4.4,5.5};
char vet3[5] = {'a','b','c','d','e'};
printArray(vet1, 5);
printArray(vet2, 5);
printArray(vet3, 5);
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment