#include <iostream>
using namespace std;
template<class T>
class Array{
public:
T U[10];
friend void DataOut(Array<string>);
friend void GetData(Array<string>);
};
void DataOut(Array<string> Array1){
cout << Array1.U[0];
}
void GetData(Array<string> Array1){
cin >> Array1.U[0];
cin.clear();
}
int main(){
Array<string> Arr1;
GetData(Arr1);
DataOut(Arr1);
}
I made a class template and created two functions: GetData
for entering string and DataOut
for printing that string, but after entering string it doesn't print it. What have I done wrong?