Pan cake sorting

In c++ what function can we use for flipping from index 0 to some index …??