zoukankan      html  css  js  c++  java
  • 一点关于指针的说明

    1.int a;

         a是整形变量

         a =5;

    2.int *a;

         a是指向整形的指针

         int *a;

         int b=4;

         a = &b;

    3.int * a[10];

         a是指针数组,a是一数组,元素是指针。

    4.char *a[10];和(char*)a[10];的区别是什么?还有((char *)a)[10];

         第一个是指针数组,第二个是数组指针,第三个是????我也说不太清,大家帮帮忙看看

     补充修改:((char *)a)[10];是void *a转化为char* a的一维数组就相当于普通的char a[10];

    ///////////////////////////////////////////////////////////////////////////////////////////

     int temp = shpheader.iFileCode;
     if(!g_bBigEndian) SwapWord(sizeof(int),(TCHAR*)&temp);

    SwapWord(int length,TCHAR* wordP){
     int  i;
        TCHAR temp;

        for( i=0; i < length/2; i++ )
        {
      temp = wordP[i];
      wordP[i] =  wordP[length-i-1];
       wordP[length-i-1] = temp;

        }

    ///////////////////////////////////////////////////////////////////////////////////////////

    上下两个代码等价,仔细考虑一下

    ///////////////////////////////////////////////////////////////////////////////////////////

     if(!g_bBigEndian) SwapWord(sizeof(int),&temp);

    SwapWord(int length,void* wordP){
     int  i;
        TCHAR temp;

        for( i=0; i < length/2; i++ )
        {
           temp = ((TCHAR *) wordP)[i];
           ((TCHAR *)wordP)[i] = ((TCHAR *) wordP)[length-i-1];
           ((TCHAR *) wordP)[length-i-1] = temp;

     }

    ///////////////////////////////////////////////////////////////////////////////////////////

         

  • 相关阅读:
    k8s中负载均衡器【ingress-nginx】部署
    利用procedure批量插入数据
    一次socket.error: [Errno 99] Cannot..报错排查
    k8s使用Job执行任务失败了怎么办
    采坑指南——k8s域名解析coredns问题排查过程
    如何批量删除k8s资源对象
    史上最全docker基础知识汇总
    docker镜像制作必备技能
    kubernetes垃圾回收器GarbageCollector源码分析(一)
    python标准库-日志logging
  • 原文地址:https://www.cnblogs.com/8586/p/1249497.html
Copyright © 2011-2022 走看看