Compilation error peeping in


#1

redefinition of ‘int main()’
This compilation error is coming repeatedly. I tried with another IDE it’s working fine. the same issue in other functions based questions as well.


#2

int main is already define. Don’t remove comment of main.


#3

Do no uncomment the give code , and don’t define another int main fucntion , just define your function that is needed for the problem !!


#4
template <class T>
int index_of_largest(T a[], int sze)
{
    T max = a[0];
    int index_of_max = 0;
    for (int index = 1; index < sze; index++){
        if (a[index] > max)
        {
            max = a[index];
            index_of_max = index;
        }
    }
    return index_of_max;
}
using this, i think it will help to you !!!