Advertisement
Guest User

Untitled

a guest
May 6th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. int killBacktrack( char *in ) {
  2. int i = 0;
  3. while( in[i] != '\0' && in[i] != 'B' ) ++i;
  4. if( in[i] == '\0' ) return 0; //False, no more left
  5. while( in[i+1] != '\0' ) {
  6. in[i-1] = in[i+1]; // Copy everything back 2 places, overriding the BX statements
  7. ++i;
  8. }
  9. in[i-1] = '\0';
  10. return 1; // True, killed a backtrack
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement