AndreiL
Welcome to AndreiL.
Enjoy your time.
Please log in.

Recursive inversion of a list of integers (pointers)

Go down

Recursive inversion of a list of integers (pointers)

Post by Lucaci Andrei on Thu Oct 04, 2012 4:22 am

1
2
3
4
5
6
void invert(int* a, int pos, int size, int* newlist){
if (pos<size){
invert(a, pos+1, size, newlist);
newlist[size-pos-1]=a[pos];
}
}

avatar
Lucaci Andrei
"Tata Lor"


Number of messages : 222
Points : 2266743
Reputation : 1007
Registration date : 2008-08-15
Age : 26
Location : Cluj-Napoca

View user profile http://www.andreil.wgz.ro

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum