Espaços nominais
Variantes
Acções

std::size_t

Da cppreference.com
< cpp‎ | types

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
 
Apoio a tipos
Tipos básicos
Original:
Basic types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos fundamentais
Tipos inteiros de largura fixos(C++11)
Limites numéricos
Original:
Numeric limits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
C numérico limita interface
Informações de tipo de tempo de execução
Original:
Runtime type information
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Características de tipo
Original:
Type traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Principais categorias de tipo
Original:
Primary type categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Propriedades de tipo
Original:
Type properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
Operações apoiadas
Original:
Supported operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Relacionamentos e consultas de propriedade
Original:
Relationships and property queries
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
(C++11)
Tipo modificações
Original:
Type modifications
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Transformações tipo
Original:
Type transformations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
Digite constantes traço
Original:
Type trait constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido no cabeçalho <cstddef>
Definido no cabeçalho <cstdio>
Definido no cabeçalho <cstring>
Definido no cabeçalho <ctime>
typedef/*implementation-defined*/ size_t;
std::size_t é do tipo unsigned inteira do resultado do operador sizeof eo operador alignof.
Original:
std::size_t is the unsigned integer type of the result of the sizeof operator and the alignof operator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Notas

size_t pode armazenar o tamanho máximo de um objeto, teoricamente possível, de qualquer tipo (incluindo matriz). Em muitas plataformas (uma exceção são sistemas com endereçamento segmentado) std :: size_t pode armazenar o valor de qualquer ponteiro não-membro, caso em que é sinônimo de std::uintptr_t.
Original:
size_t can store the maximum size of a theoretically possible object of any type (including array). On many platforms (an exception are systems with segmented addressing) std::size_t can safely store the value of any non-member pointer, in which case it is synonymous with std::uintptr_t.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::size_t é comumente utilizado para indexação de matriz e contagem de loop. Programas que usam outros tipos, como unsignedint, para indexação de matriz pode falhar em, por exemplo, Sistemas de 64 bits em que o índice excede UINT_MAX ou se se baseia em 32 bits aritmética modular.
Original:
std::size_t is commonly used for array indexing and loop counting. Programs that use other types, such as unsignedint, for array indexing may fail on, e.g. 64-bit systems when the index exceeds UINT_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.
Quando a indexação C + +, tais como recipientes de std::string, std::vector, etc, do tipo apropriado é o membro size_type typedef fornecida por esses recipientes. Ele é geralmente definida como um sinônimo para std::size_t.
Original:
When indexing C++ containers, such as std::string, std::vector, etc, the appropriate type is the member typedef size_type provided by such containers. It is usually defined as a synonym for std::size_t.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Exemplo

#include <cstddef>int main(){const std::size_t N =100;int* a = new int[N];for(std::size_t n =0; n<N;++n) a[n]= n; delete[] a;}


[editar]Veja também

assinado tipo inteiro retornado quando subtraindo dois ponteiros
Original:
signed integer type returned when 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.

(typedef)[edit]
byte offset do início de um tipo padrão de disposição-membro especificado
Original:
byte offset from the beginning of a standard-layout type to specified member
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função macro)[edit]
close