fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char *hand = "This is a hand";
  6. char *handSorted = malloc(strlen(hand)+1);
  7. handSorted[0] = '\0';
  8. strcat(handSorted, &hand[2]);
  9. printf("hand: \"%s\", handSorted: \"%s\"", hand, handSorted);
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 2288KB
stdin
Standard input is empty
stdout
hand: "This is a hand", handSorted: "is is a hand"