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;
    }
    
    
  • 相关阅读:
    Maven在dos窗口中的命令
    11. Spring Boot JPA 连接数据库
    2.JPA学习总结
    1.JPA概要
    10.Maven依赖排除 禁止依赖传递 取消依赖的方法
    10. Spring Boot JDBC 连接数据库
    9.Spring Boot实战之配置使用Logback进行日志记录
    $GLOBALS['HTTP_RAW_POST_DATA'] 和$_POST的区别
    !!!四种常见的 POST 提交数据方式(含application/json)
    PhpStorm Git 配置
  • 原文地址:https://www.cnblogs.com/hugeng007/p/9320891.html
Copyright © 2011-2022 走看看