Posted 2019-07-17Updated 2022-07-04Learning-Note-學習筆記a few seconds read (About 71 words)字串交換 (Swap String)字串交換 實作教學與筆記。 說明使用指標的指標(多重指標)來實現。 1234567891011121314#include <stdio.h>void swap(char** str1_ptr, char** str2_ptr) { char *temp = *str1_ptr; *str1_ptr = *str2_ptr; *str2_ptr = temp;}void main() { char* str1 = "Hello"; char* str2 = "World"; swap(&str1, &str2); printf("str1 is %s, str2 is %s", str1, str2);}字串交換 (Swap String)https://meowlucian.github.io/C/Common/Swap-String/AuthorMeow LucianPosted on2019-07-17Updated on2022-07-04Licensed under#CodeC