hello all
I needed to cut a string at a certain point and swap the position of the pieces so I did the following functions [it does not work well] :
void findcutswitch(string unlock_w, char ring[][26])
{
for(int i=0; i<3; i++)
{
for(int j=0; j<26; j++)
{
if(ring[i][j]==unlock_w[i])
{
int y=i;
int z=j;
for(int u=0; u<i; u++)
for(int p=0; p<j; p++)
swapO(ring[y][z],ring[u][p]);
y++;
z++;
}
}
}
}
void swapO(char &x, char &y)
{
char temp;
temp=x;
x=y;
y=temp;
}
your help is appreciated :)