Exportar (0) Imprimir
Expandir todo
div
eof
Expandir Minimizar
Este tema aún no ha recibido ninguna valoración - Valorar este tema

wctob

Determines if a wide character corresponds to a multibyte character and returns its multibyte character representation.


int wctob(
   wint_t wchar
);

Parameters

wchar

Value to translate.

If wctob successfully converts a wide character, it returns its multibyte character representation, only if the multibyte character is exactly one byte long. If wctob encounters a wide character it cannot convert to a multibyte character or the multibyte character is not exactly one byte long, it returns a –1.

The wctob function converts a wide character contained in wchar to the corresponding multibyte character passed by the return int value, if the multibyte character is exactly one byte long.

If wctob was unsuccessful and no corresponding multibyte character was found, the function sets errno to EILSEQ and returns -1.

Routine Required header Compatibility

wctob

<wchar.h>

ANSI, Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For additional compatibility information, see Compatibility in the Introduction.

This program illustrates the behavior of the wcstombs function.

// crt_wctob.c
#include <stdio.h>
#include <wchar.h>

int main( void )
{
    int     bChar = 0;
    wint_t  wChar = 0;

    // Set the corresponding wide character to exactly one byte.
    wChar = (wint_t)'A';

    bChar = wctob( wChar );
    if (bChar == WEOF)
    {
        printf( "No corresponding multibyte character was found.\n");
    }
    else
    {
        printf( "Determined the corresponding multibyte character to"
                " be \"%c\".\n", bChar);
    }
}

Output

Determined the corresponding multibyte character to be "A".

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

¿Te ha resultado útil?
(Caracteres restantes: 1500)
Gracias por sus comentarios

Adiciones de comunidad

AGREGAR
Mostrar:
© 2014 Microsoft. Reservados todos los derechos.