私はバイトとポインタを取得しようとしていますが、それらがどのように格納されているかは、誰でも説明したり、私の質問のいくつかに答えたりすることができます. ありがとうございました
int num = 513; <-- allocating a 4 bit memory by initializing
//[01][02][00][00] <-- (numbers are sorted and shown as litle endian)
char * ptr = # //char is (one byte)
↓
//[01][02][00][00]
// pointer always start from the [0] (as in this array byte length)
// in the allocated address in the memory ptr[0] is in this case = [01]
// (printed as %x02 "printf("the byte %02x\n",ptr[0]);" - if it's only
//single number 1 a zero will be added on the length so it prints out as 01)
int * ptr = # //now creating a pointer with the type of int (four bytes)
↓ ↓ ↓ ↓
//[01][02][00][00]
- この int ポインターの最初のバイトにアクセスするにはどうすればよいですか? 【質問01】
- 最初のバイト ([01]) 内のバイトを確認する方法はありますか? 【質問02】
- ポインターはアドレスをどこに保存しますか? 0x233828ff21 などのアドレスを保存するために RAM にメモリ空間を割り当てる必要がありますか? その場合、この (0x233828ff21) アドレスには多くのバイトが必要ですか? 【質問03】
- この int ポインターは、型の長さ (4 バイト) をどこに格納しますか? 【質問05】
long long * ptr = #
[01][02][00][00][00][00][00][00]のようなより長いバイトのメモリ割り当てを持つ型を宣言するとどうなるか、これらの最後の 4 つが別のプログラムによって既に割り当てられて使用されている可能性はありますか? 読めますか?【質問06】- バイナリは 0 と 1 だけで、そのうちの 1 つ (0 または 1) はバイトと呼ばれますか? 【質問07】
- 1バイトは8ビットですよね?この Web サイト ( https://www.rapidtables.com/convert/number/decimal-to-binary.html )で数字の 1 を 8 に変換すると、16 ビットの 0000000000000001 になるのはなぜですか? 【質問08】