在指针中保存确定的位置
save determinate positions in pointer
我需要在uint8_t
指针确定数组的位置。
示例:
uint8_t array[40] = {1,2,3,etc...}
uint8_t *pointer = array[5] - [25]
。保存在指针位置仅5到25之间。我需要C 语言。
感谢社区!
// Indices for the desired range of values.
constexpr std::size_t first = 5;
constexpr std::size_t last = 15;
// Create a new array with the appropriate size.
uint8_t array2[last - first];
// Copy the data to the array.
std::copy(array + first, array + last, std::begin(array2));
相关文章:
- 如何在向量中保存位置以供以后插入?
- 如何选择文件保存到的位置?
- 在屏幕上的确切位置保存和恢复Qt小部件
- 独立 exe:磁盘上保存配置文件和日志的位置
- 在指针中保存确定的位置
- 使用 fstream 将文件数据从当前位置保存到文件末尾
- QT4 QListView保存图标位置下一次由手动移动
- 将文件保存在不同的linux位置
- 将它们(函数)保存在内存中的同一位置
- 保存可移植可执行文件的位置
- c++,指向同一位置的两个指针如何保存不同的值
- C++ 在 2D 数组中保存位置
- C++ 如何将内存中的文件流保存到另一个位置
- MFC:如何在旧版 MFC 版本 6 中保存工具栏的位置
- 将数据保存在缓存中的技术,位置
- 如何保存min_element结果的位置
- 如何在InstallShield中使用用户定义的保存位置
- 保存itkImage为DICOM时,不写入图像位置/方向
- 保存和恢复内存位置列表的清洁机制
- 自定义客户端应用程序-需要控制文档保存的位置