question

i dont know why it is not run , it is show me red line under fun and fun7 in the main part ,can any one help please?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<string>
using namespace std;

template <typename T, int size>
void fun (T arra[] ,int size){
	
cout<<"enter please"<<endl;
for(int i=0; i<size; i++){
	cin>>arra[i];
}
}
template <typename T ,int size>
void fun7(T arra[],int size){
	
cout<<"the inferse for it is "<<endl;
for(int i=size;i>0;i--){
	cout<<arra[i];
}
}
int main(){
int arra[5];
fun(arra,5);
cout<<"******************"<<endl;
fun7(arra,5);



system("pause");
return 0;
}

thank you
any help please?
No clue what you are trying to do or accomplish here?
It works if you remove the templates.

Also this line: for(int i=size;i>0;i--)

Change it to: for(int i=size-1;i>=0;i--)

You want it to start from the 4th element and go all the way down to the 0th element.

Last edited on
Topic archived. No new replies allowed.