gpt4 book ai didi

c - 错误 : 'uint16_t' undeclared?

转载 作者:太空狗 更新时间:2023-10-29 16:25:36 25 4
gpt4 key购买 nike

我有密码

#include <emmintrin.h>
#include <stdio.h>

void print128_num(__m128i var)
{
uint16_t *val = (uint16_t*) &var;
printf("Numerical: %i %i %i %i %i %i %i %i \n",
val[0], val[1], val[2], val[3], val[4], val[5],
val[6], val[7]);
}
int main(void)
{
__m128i a = _mm_set_epi32(4, 3, 2, 1);
__m128i b = _mm_set_epi32(7, 6, 5, 4);
__m128i c = _mm_add_epi32(a, b);

print128_num(c);

return 0;
}

并且我在未声明 uint16_t 时遇到错误。我将 GCC 与 MINGW 一起使用。

这是完整的错误。

||In function 'print128_num':|
|6|error: 'uint16_t' undeclared (first use in this function)|
|6|error: (Each undeclared identifier is reported only once|
|6|error: for each function it appears in.)|
|6|error: 'val' undeclared (first use in this function)|
|6|error: expected expression before ')' token|

最佳答案

您需要包含 stdint.hinttypes.h 以获得 uint16_t

关于c - 错误 : 'uint16_t' undeclared?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17436527/

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