Hello everyone..
Would anyone know why I can't do the below. I'm not the best programmer in the world so I'm wondering why the below won't work. I get an error
'A template declaration cannot appear in block scope'
No doubt it's due to my lack of understanding of the topic. Thank you.
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
template<typename T>
T one = "test";
T two = 255;
T three = 287.52;
T four = 'x';
cout << one << " " << two << " " << three << " " << four << endl;
system(pause>nul);
}