Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、二次元の があります。要素はまたはarray[8][8]で満たされています。だから私の質問は、1行全体を8ビット長の符号なし整数に変換するにはどうすればよいですか? 10
array[8][8]
1
0
Cでコーディングしています。
このような:
int array[8][8]; /* this is what you have */ unsigned row0 = 0; int i; for( i = 0; i < 8; i++ ) row0 |= (unsigned)array[0][i] << i; /* row0 now contains the converted number */
これは、データが最下位ビットが最初であることを前提としています。