Espacios de nombres
Variantes
Acciones

mbstowcs

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

 
 
 
Terminadas en nulo de varios bytes
Ancho / multibyte conversiones
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)
Convierte una cadena de caracteres de varios bytes de la matriz cuyo primer elemento es apuntado por src en la representación de caracteres anchos. Caracteres convertidos se almacenan en los elementos sucesivos de la matriz a la que apunta dst. No más de caracteres anchos len se escriben en la matriz de 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 carácter se convierte como si por una llamada a mbtowc, excepto que el estado de conversión mbtowc no se ve afectada. La conversión se para si:
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.
  • El carácter nulo multibyte se convierte y se almacena .
    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.
  • Un inválido (en el actual entorno nacional C) carácter multibyte se encontró .
    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.
  • El siguiente carácter amplio para ser almacenado sería superior 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.

Contenido

[editar] Notas

En la mayoría de las implementaciones, esta función actualiza un objeto estático global de mbstate_t tipo a medida que procesa a través de la cadena, y no puede ser llamado simultáneamente por dos hilos, mbsrtowcs se debe utilizar en tales 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 una extensión común: si dst es un puntero nulo, esta función devuelve el número de caracteres anchos que se habrían de escribir a dst, si se convierten. Similar comportamiento es estándar 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 -
puntero al array de caracteres anchos en la que se almacena la cadena ancha
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 -
puntero al primer elemento de una cadena multibyte terminada en nulo para convertir
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 anchos disponibles en el array apuntado 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

En caso de éxito, devuelve el número de caracteres anchos, sin incluir el L'\0' termina, se escribe en la matriz de 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.
En caso de error de conversión (si inválido carácter multibyte fue encontrado), vuelve (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] Ejemplo

[editar] Ver también

convierte una cadena de caracteres multibyte estrecho a la cadena de ancho, estado dado
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.

(función) [edit]
convierte una cadena ancha para reducir cadena 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.

(función) [edit]
C++ documentation for mbstowcs