zoukankan      html  css  js  c++  java
  • c++官方文档-指针

    #include<stdio.h>
    #include<iostream>
    #include<queue>
    #include<map>
    #include<memory.h>
    #include <math.h>
    #include <stdlib.h>
    #include <algorithm>
    #include <climits>
    #include <sstream>
    #include <cstdlib>
    #include<array>
    using namespace std;
    
    int main()
    {
        /**
         *
         *  *p++   // same as *(p++): increment pointer, and dereference unincremented address
         *  *++p   // same as *(++p): increment pointer, and dereference incremented address
         *  ++*p   // same as ++(*p): dereference pointer, and increment the value it points to
         *  (*p)++ // dereference pointer, and post-increment the value it points to
         */
        int jj = -1;
        int j = 1;
        cout<<&j<<endl;
        cout<<&jj<<endl;
        int * p=&j;
    //    int k = *p++;
        int k = *++p;
        cout<<p<<endl;
    //    int k = ++*p;
    //    int k = (*p)++;
        cout<<k<<endl;
        return 0;
    }

    ++的操作高于*

  • 相关阅读:
    Asp.net操作Excel----NPOI
    Python第一模块
    Sping笔记一览
    IO流技术一览
    事务技术一览
    日常问题记录
    分页与JDBC显示文档。
    分页技术与JDBC一览
    JDBC 技术开发
    MYSQL
  • 原文地址:https://www.cnblogs.com/shuiyonglewodezzzzz/p/8151923.html
Copyright © 2011-2022 走看看