20200118-指针的特殊用法

  1. #include "stdafx.h"

  2. #include "iostream"

  3. #include "cstring"

  4. #include "string"

  5. using namespace std;

  6. unsigned long left(unsigned long num,unsigned ct);

  7. char * left(const char * str,int n=1);

  8. int main()

  9. {

  10. char * trip="Hawaii!!";

  11. cout<<*trip<<endl;

  12. cout<<trip<<endl;

  13. //int *bb=6;  这样写是不允许的

  14. int a=6;

  15. int *pt=&a;

  16. int b=*pt * *pt;

  17. cout<<b<<endl;

  18. }

运行结果:
posted @ 2020-05-21 08:15  财盛  阅读(168)  评论(0编辑  收藏  举报