資源簡介
自編函數實現兩個字符串的交換。
代碼片段和文件信息
#include?
using?namespace?std;
void??swap_int(int?*a?int?*b)
{
int?temp;
temp?=?*b;
*b?=?*a;
*a=?temp;
}
void?swap_char(?char?**s1??char?**s2)
{
char?*s?=?NULL;
s?=?*s2;
*s2?=?*s1;
????????*s1?=?s;
}
- 上一篇:購物打折
- 下一篇:楊輝三角形(c++源碼)
評論
共有 條評論