c++官方文档-指针

news/2024/7/6 6:41:30
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;
}

++的操作高于*

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

转载于:https://www.cnblogs.com/shuiyonglewodezzzzz/p/8151923.html


http://www.niftyadmin.cn/n/3538198.html

相关文章

【聚类学习】时间序列聚类—10年回顾概括性综述

目录 一、引言 二、时间序列聚类的作用 三、时间序列数据的聚类问题正式定义 四、时序数据的聚类的挑战 五、时间序列数据聚类有什么用 六、时间序列聚类技术的分类 七、时间序列聚类的四步骤&#xff1a; 1、时间序列的representation 2、时序聚类中相似度的定义 关于…

第 4 章 Vulnerability Scanner

目录 4.1. Nessus4.2. OpenVAS4.1. Nessus http://www.nessus.org/ [rootcentos6 src]# rpm -ivh Nessus-4.4.1-es6.x86_64.rpm Preparing... ########################################### [100%]1:Nessus ##################################…

【深度学习3】Self-Attention注意力机制(李宏毅)

2021 - 自注意力机制(Self-attention)(上)_哔哩哔哩_bilibili 2021 - 自注意力机制 (Self-attention) (下)_哔哩哔哩_bilibili 目录 三种输入输出间关系 常规方法 注意力机制原理 Self-attention的问题 和其他网络对比 在Graph上的应用 更多 三种输入输出间关系 3种类…

saltstack的探索-grains

saltstack的探索-grains 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311…

【深度学习4】GNN图神经网络介绍(李沐)

目录 介绍 图的定义 数据的图的表示 1、图片的图表示&#xff08;11&#xff1a;50&#xff09; 2、文本的图表示 3、分子的图表示 4、社交网络的图表示 数据统计 三大类问题 1、图层面的任务 2、顶点层面的任务 3、边级层面的任务 将图用在机器学习上的挑战 1、挑战 …

【深度学习5】GCN 图卷积神经网络原理

目录 前言 GCN是做什么的 GCN主要思想 数学原理 GCN长什么样 GCN为什么是这个亚子 GCN有多牛 其他关于GCN的点滴 参考文章&#xff1a; 何时能懂你的心——图卷积神经网络&#xff08;GCN&#xff09; - 知乎 (zhihu.com) 2020年&#xff0c;我终于决定入门GCN - 知…

ELSE 技术周刊(2018.01.01期)

业界动态 小程序又搞事情&#xff0c;H5 开发的春天来了&#xff01; 就在刚刚&#xff0c;微信官方公布了几个小程序爆炸性的新闻&#xff0c;在 2017 年的年底&#xff0c;这个新闻似乎是在告诉大家&#xff0c;小程序能做的事越来越多&#xff0c;2018 年你再也没法再忽视它…

【深度学习6】图神经网络库 PyTorch Geometric(PYG)手动安装流程(绝对成功)

目录 PyTorch Geometric简介 安装PyTorch Geometric PyTorch Geometric简介 官方网站&#xff1a;PyG Documentation — pytorch_geometric documentation (pytorch-geometric.readthedocs.io) PyTorch Geometric 中设计了一种新的表示图数据的存储结构&#xff0c;也是 PyT…