gpt4 book ai didi

objective-c - const 是在 CGFloat 之前还是之后?

转载 作者:太空狗 更新时间:2023-10-30 03:17:45 28 4
gpt4 key购买 nike

这有关系吗? Const before or const after?我猜测无论是将 const 放在 CGFloat 之前还是之后,它都会使 CGFloat 的值保持不变,但是指针呢?这对 Objective-C 是否正确:

// Example.h

extern CGFloat const kPasscodeInputBoxWidth;


// Example.m

CGFloat const kPasscodeInputBoxWidth = 61.0f;

最佳答案

它可以在之前或之后。对于指针,重要的是 const 是在星号之前还是之后结束:

const int *a;    // pointer to const int -- can't change what a points at
int const *a; // same

int *const a; // const pointer to int -- can't change the pointer itself.
// Note: must be initialized, since it can't be assigned.

关于objective-c - const 是在 CGFloat 之前还是之后?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5875474/

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