Examples of using Pointer size in English and their translations into Russian
{-}
-
Official
-
Colloquial
The'sizeof' operator calculates the pointer size.
As a result, the pointer size is divided by'sizeofWCHAR.
The number of bytes being compared depends on the pointer size.
What does the pointer size depend on in C++ on different platforms?
The reason is that the'sizeof' operator returns the pointer size.
The pointer size in it is divided by the size of one character.
We should use the type which will correspond to the pointer size.
When trying to calculate the pointer size, a compilation error will occur.
The pointer size can be much smaller than the size of the structure variable.
Both examples do not take into account that the pointer size may differ from 32-bits.
It means that it is the pointer size which is passed into a function instead of the buffer size. .
One should use that type which would conform with the pointer size as follows.
The sizeof() operator calculates the pointer size instead of the number of bytes in a string.
As a result, the sizeof(buf) operator evaluates not the buffer size, but the pointer size.
The'sizeof(uc)' expression returns the pointer size, not the buffer size. .
The row pointer size is usually four bytes, but may grow in the future for really big tables.
The"sizeof(msg->text)" expression calculates the pointer size, not the string length.
If we divide the pointer size by the byte size, we will always get a value larger than one.
The'sizeof(iNeighbors)' expression is illegal, as it returns the pointer size, not the array size. .
The sizeof() operator returns the pointer size instead of the size of the buffer with data.
The number of items in an array allocated by the'new'operator equals the pointer size in bytes.
The sizeof() operator actually calculates the pointer size instead of the number of bytes in a string.
Actually it is a common case when developers want to pass a buffer size instead of a pointer size into a function.
It is not important if the pointer size coincides with the size of the'unsigned long' type.
The author of this inaccurate code did not take into account that the pointer size may excess 32 bits later.
The'sizeof(utf8)' expression returns the pointer size, not the size of the allocated memory buffer.
The'fbuf' variable is a pointer, which means that sizeof(fbuf)will return the pointer size instead of the array size. .
However, most contemporary operating systems of general purpose(desktop UNIX-compatible systems, MS Windows)use data models where the pointer size corresponds to the capacity of the address bus employed by the architecture of these platforms.
Then calculation of"ptr+ 0xFFFFFFFFu" takes place, butthe result of it depends on the pointer size on the particular architecture.
The error is this: the sizeof()operator returns the pointer size, not the buffer size. .