gpt4 book ai didi

c++ - Const 指针和指向 const 的指针

转载 作者:搜寻专家 更新时间:2023-10-31 01:48:11 24 4
gpt4 key购买 nike

<分区>

而不是这样做:

int* const p;

还有这个:

const int* p;

你能不能让它更容易阅读:

typedef int* ptr;
const ptr p; //Constant pointer to an integer

和:

typedef const int ptr;
ptr* p; //Pointer to a constant integer

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com