zoukankan      html  css  js  c++  java
  • pointer1

    The Unknown Word

    The First The Second
    videoinput library 视频输入库
    crocodil ['kra:kedail]鳄鱼
    preprocessor 预处理器 [pri:'prousese(r)]
    novice ['na:vis]初学者,新手,
    intimidate 恐吓,威胁[in'timideit]
    declaration [dekle'reition]声明,宣言
    used [ju:st]习惯于
    SDK software development kit 软件开发工具
    version selector 版本选择器
    xproj 新一代的项目文件,是XML的格式

    Arguments to main

    Arguments is often a novice programmers' first encounter with pointers to array to pointers and can prove intimidating.

    • argv is used to refer to an array of strings,its declaration will look like this:
    char*argv[]	//equivalent to to that show above:char **argv
    int main(int argc,char *argv[])		//int main(int argc,char **argv)
    

    p++、(p)++、++p、++p ——the difference

    int a[5]={1,2,3,4,5};
    int *p = a;

    • *p++ Firstly,get the value to which p ponints(The first element p points to),and increase the pointer p by 1.
            cout << *p++; // the result is 1
    
            cout <<(*p++);  // the result is 1
    
    • (*p)++ Firstly,get the value the pointer p points to(the first element of the array),and increase the value by 1(the first element of array is 2).
            cout << (*p)++; //  1
            cout <<((*p)++);  //2
    
    • *++p Firstly,increase the pointer p by 1(At this point,point to the second element of the array),and the operator * gets the value.
            cout << *++p; //  2
            cout <<(*++p)  //2
    
    • ++*p get the value pointer p points to(the first element of the array),and the value increase by 1(the element become 2).
          cout <<++*p; //   2    
            cout <<(++*p)  //2
    

    #include<iostream>
    int main(){
    int a[5]={1,2,3,4,5};
    int *p=a;
    cout<<p<<endl;
    cout<<*p++<<endl;
    cout<<(*p++)<<endl;
    return 0;
    }
    
    
  • 相关阅读:
    linux上搭建tingproxy服务
    windows上搭建linux系统
    PHP将图片流存为图片文件
    openLayer矩形框选要素,展示要素属性
    点击选中的要素,更换标注图片,并添加文本标注
    openLayer点击要素获取对应的属性信息
    openLayer实现放大缩小
    openLayer的切换中心点、定位功能
    使用openLayer加载arcgis中的地图
    openLayer实现两个地图联动
  • 原文地址:https://www.cnblogs.com/hugeng007/p/9320891.html
Copyright © 2011-2022 走看看