Skip to content

Instantly share code, notes, and snippets.

@Caesar-Victory
Created September 13, 2022 09:52
Show Gist options
  • Select an option

  • Save Caesar-Victory/bc7c59b13029bf8cc5687a51ae6b9f8c to your computer and use it in GitHub Desktop.

Select an option

Save Caesar-Victory/bc7c59b13029bf8cc5687a51ae6b9f8c to your computer and use it in GitHub Desktop.
#C
// 内联函数,注意原地修改,因此传参均为字符指针,不需要返回值
static inline void swap(char* a, char* b) {
char c = *a;
*a = *b;
*b = c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment