Mine
public text v1 · immutable#include <iostream>
using namespace std;
void prevrti(char a[],int n);
main()
{
char a[] = "bobo_e_boki";
cout << a << endl;
prevrti(a,11);
cout << a << endl;
}
void prevrti(char a[], int n)
{
char *p1 = &a[0], *p2 = &a[n-1];
char t;
for(;*p1 != '_' && *p2 != '_';)
{
*p1++;
*p2--;
}
p1 = &a[0];
while(p1 != '_')
{
t = *p1;
*p1 = *p2;
*p2 = t;
*p1++;
*p2++;
}
}