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;
    }
    
    
  • 相关阅读:
    HDFS文件系统
    使用cmake安装单实例mysql
    python读取数据库表数据并写入excel
    linux文件行数统计
    ORACLE清空回收站操作
    Oracle 11g静默安装
    图解Java设计模式之职责链模式
    图解Java设计模式之策略模式
    图解Java设计模式之状态模式
    图解Java设计模式之解释器模式
  • 原文地址:https://www.cnblogs.com/hugeng007/p/9320891.html
Copyright © 2011-2022 走看看