菜菜

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
#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;
}

++的操作高于*

posted on 2017-12-31 01:01  好吧,就是菜菜  阅读(202)  评论(0编辑  收藏  举报