ptrdiff_t
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <stddef.h>
|
||
typedef /*implementation-defined*/ ptrdiff_t; |
||
ptrdiff_t è il tipo intero con segno del risultato della sottrazione dei due puntatori.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.
You can help to correct and verify the translation. Click here for instructions.
Note
ptrdiff_t è utilizzato per l'aritmetica dei puntatori e l'indicizzazione di array, se i valori negativi sono possibili. Programmi che utilizzano altri tipi, come int, può fallire su, ad esempio Sistemi a 64 bit, quando l'indice supera INT_MAX o se si basa su 32 bit aritmetica modulare.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.
You can help to correct and verify the translation. Click here for instructions.
Solo i puntatori alle elementi della matrice stessa (compreso il puntatore uno oltre la fine della matrice) possono essere sottratti tra loro.
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.
You can help to correct and verify the translation. Click here for instructions.
Se un array è così grande (maggiore di elementi PTRDIFF_MAX, ma meno di SIZE_MAX byte), che la differenza tra due puntatori non possono essere rappresentabile come
ptrdiff_t, il risultato della sottrazione tali due puntatori è indefinito.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.
You can help to correct and verify the translation. Click here for instructions.
Per gli array char di lunghezza inferiore a PTRDIFF_MAX,
ptrdiff_t funge da controparte firmata size_t: è in grado di memorizzare le dimensioni della matrice di qualsiasi tipo ed è, sulla maggior parte delle piattaforme, sinonimo di 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.
You can help to correct and verify the translation. Click here for instructions.
Vedi anche
senza segno tipo intero restituito dal gestore 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) | |
| byte offset from the beginning of a struct type to specified member (funzione macro) | |
C++ documentation for ptrdiff_t
| |