题目写个函数交换两个指针的值。
正解:
#include
using namespace std;
void ex(char **a,char **b)
{
char *c;
c=*a;
*a=*b;
*b=c;
}
int main()
{
char *pt=”ptn”;
char *pt_another=”pt_anothern”;
cout<
题目写个函数交换两个指针的值。
正解:
#include
using namespace std;
void ex(char **a,char **b)
{
char *c;
c=*a;
*a=*b;
*b=c;
}
int main()
{
char *pt=”ptn”;
char *pt_another=”pt_anothern”;
cout<