在uint8\u t数组中插入() 我是C++的新手,当我尝试在UINT8*T数组中插入一个元素时,我会得到以下错误。请帮我解决这个问题

在uint8\u t数组中插入() 我是C++的新手,当我尝试在UINT8*T数组中插入一个元素时,我会得到以下错误。请帮我解决这个问题,c++,arrays,string,C++,Arrays,String,错误 代码是 #包括 #包括 使用名称空间std; int main() { uint8_t数组[]={0x00,0x11,0x22,0x33,0x44}; 插入(1,0xff); 对于(inti=0;i这不是您可以插入的东西,像uint8\t这样的基本类型没有函数。这就是“非类类型”的含义 你需要的std::vector确实有。它来自#include P>一个要记住的是C++有一个快速且容易的迭代器方法,如果你不关心索引:,你可以使用它。 for(自动&e:array){ CUT注释:包含了

错误

代码是

#包括
#包括
使用名称空间std;
int main()
{
uint8_t数组[]={0x00,0x11,0x22,0x33,0x44};
插入(1,0xff);

对于(inti=0;i这不是您可以插入的东西,像
uint8\t
这样的基本类型没有函数。这就是“非类类型”的含义

你需要的
std::vector
确实有。它来自
#include

<> P>一个要记住的是C++有一个快速且容易的迭代器方法,如果你不关心索引:

,你可以使用它。
for(自动&e:array){

CUT注释:<代码>包含了这里不相关,甚至不属于大多数C++程序。我能知道如何将uTI88T数组[]复制到STD::vector?只使用<代码> STD::向量< /代码>:<代码> STD::向量数组= {0x00,0x11,0x22,0x33,0x44 }。;
这给了我一组错误main.cpp:14:3:error:“vector”不是'std'std::vector array={0x00,0x11,0x22,0x33,0x44};^~~main.cpp:14:22:error:在'>'标记std::vector array={0x00,0x11,0x22,0x33,0x44}之前应该有主表达式;^main.cpp:14:24:错误:“数组”未在此作用域中声明std::vector数组={0x00,0x11,0x22,0x33,0x44};你是否如我所说
#包含#谢谢你的评论#包含。错误现在已经解决了。你能用向量自己为问题写一个答案吗?因为这会给我一个清晰的问题答案吗?
main.cpp: In function ‘int main()’:

main.cpp:10:9: error: request for member ‘insert’ in ‘array’, which is of non-class type ‘uint8_t [5] {aka unsigned char [5]}’
   array.insert(1,0xff);
array[] = {0x00, 0xff, 0x11,0x22,0x33,0x44};