An interesting question: C++ and friendship...
Here is the complete code:
#include "stdafx.h"
#include <iostream>
using namespace std;
template<class T>
class students
{
public:
friend void shows(T&);
T name;
void ShowInfo();
public:
students(T x)
{
name=x;
}
};
template<class T>
void shows(students<T> &stu)
{
cout << stu.name << endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
students<int> mat(10);
shows(mat);
return 0;
}
It was also the privateness which made problems.
Best regards