Skip to content

Instantly share code, notes, and snippets.

@qpfiffer
Created October 29, 2011 00:27
Show Gist options
  • Select an option

  • Save qpfiffer/1323913 to your computer and use it in GitHub Desktop.

Select an option

Save qpfiffer/1323913 to your computer and use it in GitHub Desktop.
reverse
void quack::reverse(void)
{
int i, j, temp=0;
for (i=(frontInt), j=0; j<((numItems/2)+1);
i = (i+1) % mySize, j++) {
temp = items[i].n;
items[i].n = items[(backInt-j)%mySize].n;
items[(backInt-j)%mySize].n = temp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment