Help with errors

Can someone please help me fix the errors in this code?

#include "stdafx.h"
#include <iostream>
#include <string>

template
T Square(T value)
{
return value*value;
}

template
T Power(T value, int i)
{
int const_value = value;
for (int j = 0; j < i - 1; j++)
value *= const_value;

return value;
}

template
int Find(T array[], T element, int size_of_array); {

bool exceeds_or_no = false;
int i = 0;
for (i = 0; i < size_of_array; i++)
if (array[i] > element) { exceeds_or_no = true; break; }

if (exceeds_or_no) return i;
else
return -1;

}

using namespace std;

int main()
{
int size_of_array = 0;
int value;
int power;

cout<<"Enter value";
cin>>value;
cout<<"value ^2 = ";
cout<<"Enter power";
cin>>power;
cout<<"value ^3 = ";
cout<<"Enter size of array : ";
cin >> size_of_array;
int *array = new int[size_of_array];
cout<<"Enter elements of arrays : ";
for (int i = 0; i < size_of_array; i++)
cin>>array[i];
cout<<"Enter element";
cin>>value;
cout<<"Array subscript : "<< system("pause");
return 0;
}


ERRORS

1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(9): error C2146: syntax error : missing ';' before identifier 'Square'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(9): error C2065: 'T' : undeclared identifier
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(9): error C2146: syntax error : missing ')' before identifier 'value'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(9): error C2059: syntax error : ')'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(10): error C2143: syntax error : missing ';' before '{'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(10): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(15): error C2146: syntax error : missing ';' before identifier 'Power'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(15): error C2065: 'T' : undeclared identifier
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(15): error C2146: syntax error : missing ')' before identifier 'value'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(15): error C2059: syntax error : ')'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(16): error C2143: syntax error : missing ';' before '{'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(16): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(25): error C2061: syntax error : identifier 'T'
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(25): warning C4667: 'int Find(void)' : no function template defined that matches forced instantiation
1>c:\users\mjlhr\documents\visual studio 2010\projects\week10-1\week10-1\week10-1.cpp(25): error C2447: '{' : missing function header (old-style formal list?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Your compiler errors didn't help?

1
2
template 
 T Square(T value);


Your declarations with template are incomplete. You have to declare the template parameters:
1
2
template <typename T>
T Square(T value);
Topic archived. No new replies allowed.