Espacios de nombres
Variantes
Acciones

ptrdiff_t

De cppreference.com
< c‎ | types

Defined in header <stddef.h>
typedef /*implementation-defined*/ ptrdiff_t;
ptrdiff_t es el tipo entero con signo del resultado de restar dos punteros .
Original:
ptrdiff_t is the signed integer type of the result of subtracting two pointers.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Notas

ptrdiff_t se utiliza para la aritmética de punteros y la indización de matriz, si los valores negativos son posibles. Los programas que utilizan otros tipos, como int, puede fallar en, por ejemplo, Sistemas de 64 bits cuando el índice sobrepasa INT_MAX o si se basa en 32-bit aritmética modular .
Original:
ptrdiff_t is used for pointer arithmetic and array indexing, if negative values are possible. Programs that use other types, such as int, may fail on, e.g. 64-bit systems when the index exceeds INT_MAX or if it relies on 32-bit modular arithmetic.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Sólo punteros a los elementos de la misma matriz (incluyendo el puntero de uno pasado el final de la matriz) puede restarse de cada otro .
Original:
Only pointers to elements of the same array (including the pointer one past the end of the array) may be subtracted from each other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si una matriz es tan grande (mayor de elementos PTRDIFF_MAX, pero menos de SIZE_MAX bytes), que la diferencia entre dos punteros no puede ser representable como ptrdiff_t, el resultado de restar dos punteros tales es indefinido .
Original:
If an array is so large (greater than PTRDIFF_MAX elements, but less than SIZE_MAX bytes), that the difference between two pointers may not be representable as ptrdiff_t, the result of subtracting two such pointers is undefined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Para las matrices carbón inferiores a PTRDIFF_MAX, ptrdiff_t actúa como contraparte firmada de size_t: puede almacenar el tamaño de la matriz de cualquier tipo y es, en la mayoría de plataformas, sinónimo de intptr_t) .
Original:
For char arrays shorter than PTRDIFF_MAX, ptrdiff_t acts as the signed counterpart of size_t: it can store the size of the array of any type and is, on most platforms, synonymous with intptr_t).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ver también

tipo entero sin signo devuelto por el operador sizeof
Original:
unsigned integer type returned by the sizeof operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(typedef) [edit]
byte offset from the beginning of a struct type to specified member
(función macro) [edit]
C++ documentation for ptrdiff_t