gpt4 book ai didi

c - "Dont care"指针?

转载 作者:太空宇宙 更新时间:2023-11-04 06:37:42 24 4
gpt4 key购买 nike

<分区>

我有这样一个函数:

uint8_t getULEB128Value(uint8_t *p, uint32_t *to){
unsigned int result;
uint8_t count = 1;
uint8_t cur;

result = *p;
if(result > 0x7F){
count++;
cur = *(++p);
result = (result & 0x7F) | (cur << 7);
if(cur > 0x7F){
count++;
cur = *(++p);
result |= ((cur & 0x7F) << 14);
if(cur > 0x7F){
count++;
cur = *(++p);
result |= ((cur & 0x7F) << 21);
if(cur > 0x7F){
count++;
cur = *(++p);
result |= ((cur & 0x7F) << 28);
}
}
}
}
*to = result;
return count;
}

现在我只想知道长度,我对值不是很感兴趣...
是否可能有一个无关指针?所以写在那里的每一个值(value)都会进入必杀技?比如/dev/null?
我的意思是我当然可以在某个地方创建一个指针然后释放它,但也许已经有这样的东西了?

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