https://en.cppreference.com/w/c/language/sizeof
1. sizeof( type ) Returns the size, in bytes, of the object representation of type
2. When applied to an operand that has structure or union type,
the result is the total number of bytes in such an object, including
internal and trailing padding. The trailing padding is such that
if the object were an element of an array, the alignment requirement
of the next element of this array would be satisfied, in other words,
sizeof(T) returns the size of an element of a T[] array.
3. Number of elements in any array a including VLA (since C99) may be
determined with the expression sizeof a / sizeof a[0]. Note that
if a has pointer type (such as after array-to-pointer conversion of
function parameter type adjustment), this expression would simply
divide the number of bytes in a pointer type by the number of bytes
in the pointed type.
https://en.cppreference.com/w/c/language/operator_arithmetic
10. If the pointer P points at an element of an array with index I, then
11. P+N and N+P are pointers that point at an element of the same array with index I+N.
12. P-N is a pointer that points at an element of the same array with index {tt|I-N}}.
20. If the pointer P1 points at an element of an array with index I (or one past the end)
and P2 points at an element of the same array with index J (or one past the end), then
P1-P2 has the value equal to J-I and the type ptrdiff_t (which is a signed integer type,
typically half as large as the size of the largest object that can be declared)
探検
C++相談室 part145
■ このスレッドは過去ログ倉庫に格納されています
710デフォルトの名無しさん
2019/10/31(木) 13:21:36.49ID:Mfb82uAb■ このスレッドは過去ログ倉庫に格納されています
ニュース
- バリ島で男子生徒ら集団万引きか、防犯カメラ映像が拡散 京都の大谷中学・高校が「窃盗行為」謝罪★4 [七波羅探題★]
- 中国軍機レーダー照射、トランプ氏沈黙突く 試される日本外交 [蚤の市★]
- 【地震】青森県で震度6強 長周期地震動も 津波注意報すべて解除 ★7 [ぐれ★] [ぐれ★]
- トランプ大統領 エヌビディア製AI半導体の中国輸出許可 安全保障重視の方針転換 [蚤の市★]
- 【広島】「万引きした人を追跡」コンビニ店員の男性(46)を果物ナイフで刺したか 中国籍の少年(17)を殺人未遂容疑で現行犯逮捕 [ぐれ★]
- 【芸能】デヴィ夫人「日本では犬猫は器物。動物保護を何とか立法化したい」 人と動物が共生を力強く訴え [冬月記者★]
- (´・ω・`)君たちは冬のボーナスを何に使うのかい?
- 寒さしのげる場所があって食べ物も豊富にあるなら熊は冬眠しないの?
- 声優・矢尾一樹の妻「治療の影響で思う様に話せない彼に、近くで仕事をしてきた人が、かっこ悪い!もう辞めなよと言った。私は許さない」 [594040874]
- 【画像】TOKIO山口達也に「いいべ」された当時のJK、性加害の反動であたしこグラドルにwww [779857986]
- 【高市悲報】しかし、香港の火災とか青森の地震で不謹慎な事を言う奴が日中にいたら、そいつこそが世界の「癌」だよな [784715804]
- 気象庁・高市内閣「この後311級の地震の可能性があります。北海道〜関東の人は1週間は地震が来てもすぐ逃げられる格好をしてください」 [597533159]
