c语言指针
源程序:
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
char* p;
char a[80];
p = a;
int i = 0;
while((*p=getchar())!='\n')
{
p++;
i++;
}
a[i] = '\0';
for (p = a; *p!='\0';)
{
cout<<*p;
p++;
}
return 1;
}
运行结果: