Espaços nominais
Variantes
Acções

mbstowcs

Da cppreference.com
< c‎ | string‎ | multibyte

 
 
 
Strings terminadas multibyte
Wide / multibyte conversões
Original:
Wide/multibyte conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mbsinit
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mbstate_t
 
Defined in header <stdlib.h>
size_t mbstowcs( wchar_t* dst, const char* src, size_t len)
Converte uma cadeia de caracteres multibyte da matriz cujo primeiro elemento é apontado por src à sua representação de caracteres de largura. Caracteres convertidos são armazenados nos elementos sucessivos da matriz apontada por dst. Não mais do que len caracteres largos são escritos para a matriz destino.
Original:
Converts a multibyte character string from the array whose first element is pointed to by src to its wide character representation. Converted characters are stored in the successive elements of the array pointed to by dst. No more than len wide characters are written to the destination array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cada personagem é convertido como se por uma chamada para mbtowc, exceto que o estado de conversão mbtowc não é afetada. A conversão pára se:
Original:
Each character is converted as if by a call to mbtowc, except that the mbtowc conversion state is unaffected. The conversion stops if:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • O caractere nulo multibyte foi convertido e armazenado.
    Original:
    The multibyte null character was converted and stored.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Um inválido (na localidade C corrente) de caracteres multibyte foi encontrado.
    Original:
    An invalid (in the current C locale) multibyte character was encountered.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • O próximo personagem de largura para ser armazenado exceder len.
    Original:
    The next wide character to be stored would exceed len.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Notas

Na maioria das implementações, esta função atualiza um objeto estático global de mbstate_t tipo como ele processa através da cadeia, e não pode ser chamado simultaneamente por dois fios, mbsrtowcs deve ser usado em casos.
Original:
In most implementations, this function updates a global static object of type mbstate_t as it processes through the string, and cannot be called simultaneously by two threads, mbsrtowcs should be used in such cases.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
POSIX especifica uma extensão comum: se dst é um ponteiro nulo, esta função retorna o número de caracteres largos que seriam escritos para dst, se convertido. Comportamento semelhante é padrão para mbsrtowcs.
Original:
POSIX specifies a common extension: if dst is a null pointer, this function returns the number of wide characters that would be written to dst, if converted. Similar behavior is standard for mbsrtowcs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Parâmetros

dst -
ponteiro para matriz de caracteres de largura onde a corda larga será armazenado
Original:
pointer to wide character array where the wide string will be stored
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
src -
ponteiro para o primeiro elemento de uma string terminada em null multibyte para converter
Original:
pointer to the first element of a null-terminated multibyte string to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
len -
número de caracteres largos disponíveis na matriz apontada por dst
Original:
number of wide characters available in the array pointed to by dst
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

Em caso de sucesso, retorna o número de caracteres de largura, excluindo o L'\0' terminação, escrito para a matriz destino.
Original:
On success, returns the number of wide characters, excluding the terminating L'\0', written to the destination array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Em caso de erro de conversão (se caracteres multibyte inválido foi encontrado), retorna (size_t)-1.
Original:
On conversion error (if invalid multibyte character was encountered), returns (size_t)-1.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

[editar] Veja também

converte uma cadeia de caracteres multibyte estreita para string de largura, determinado estado
Original:
converts a narrow multibyte character string to wide string, given state
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
converte uma cadeia de largura para estreitar cadeia de caracteres multibyte
Original:
converts a wide string to narrow multibyte character string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
C++ documentation for mbstowcs