20200118-指针的特殊用法
-
#include "stdafx.h"
-
#include "iostream"
-
#include "cstring"
-
#include "string"
-
using namespace std;
-
unsigned long left(unsigned long num,unsigned ct);
-
char * left(const char * str,int n=1);
-
int main()
-
{
-
char * trip="Hawaii!!";
-
cout<<*trip<<endl;
-
cout<<trip<<endl;
-
//int *bb=6; 这样写是不允许的
-
int a=6;
-
int *pt=&a;
-
int b=*pt * *pt;
-
cout<<b<<endl;
-
}
运行结果: