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.
ファイルに大きなデータがありますが、毎回 4096 要素しか読み取っていません。したがって、2 回目に読んでいるときに、ポインターを 4097 番目の要素に更新する必要があります。それ、どうやったら出来るの?
char *p = input; /* do some code, use p instead of input*/ p = p+4096;
ptr++;
トリックを行う必要があります。
これが機能する方法は、暗黙のうちに、メモリ内の場所 + poitner が指すデータ オブジェクトのサイズであると理解します。int の場合は sizeOf(int) になります。=]