数组需要帮助

扫码查看
本文介绍了数组需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在使用C作为我的任务之一我想将一些布尔数据读入一个数组可能是一维或两个。为了节省内存,我打算制作一个结构,我将用于将布尔数据存储到二维数组中。问题是我不知道究竟哪种数据类型适合,以便我可以节省内存。我使用uint8_t作为数据类型。我需要检查我是否在正确的轨道上。


i希望在二维数组中存储位,即1'和0'。这实际上只保存了所述数组中的位,或者它是否保存了整个位索引?

即假设值[0] [j]存储{1,1,1,1,1}或

值[1] [j]存储{ 0,0,0,0,0}


代码片段如下

hi

i am using C for one of my task i want to read an some boolean data into into an array might be one dimensional or two. for saving memory i am intending to make a bit structure that i am going to use for storing boolean data into a two dimensional array. the problem is i dont know exactly which data type is suitable so that i could save memory. i have used uint8_t as a data type. all i need to check whether i am on right track or not.

i want to store bits i.e 1''s and 0''s in a two dimensional array.is that really save only the bits in said array or is it saving the whole bit in the index?
i.e suppose Value[0][j] stores {1,1,1,1,1}or
Value[1][j] stores {0,0,0,0,0}

the code snippet is as follows

展开 | 选择 | 换行 | 行号

推荐答案




这篇关于数组需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 20:07
查看更多