Namespace
Varianti

std::wcsncpy

Da cppreference.com.
< cpp‎ | string‎ | wide

 
 
Stringhe libreria
Null-stringhe terminate
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Byte stringhe
Multibyte stringhe
Stringhe larghe
Classi
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
Stringhe larghe null-terminated
Funzioni
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Carattere manipolazione
Original:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Le conversioni in formati numerici
Original:
Conversions to numeric formats
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Della gestione delle stringhe
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Matrice manipolazione
Original:
Array manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
wmemcpy
wmemmove
wmemcmp
wmemchr
wmemset
 
Defined in header <cwchar>
wchar_t *wcsncpy( wchar_t *dest, const wchar_t *src, std::size_t count );
Copie a personaggi più count della stringa puntata da ampia src (incluso il carattere nullo di terminazione grandangolo) a matrice di caratteri gamma puntato da dest.
Original:
Copies at most count characters of the wide string pointed to by src (including the terminating null wide character) to wide character array pointed to by dest.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Se count viene raggiunto prima della src intera stringa è stata copiata, la matrice risultante di caratteri estesi non è null-terminated.
Original:
If count is reached before the entire string src was copied, the resulting wide character array is not null-terminated.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Se, dopo aver copiato il carattere nullo di terminazione larga da src, count non viene raggiunto, ulteriori caratteri null larghi vengono scritti dest fino al totale di caratteri count sono stati scritti.
Original:
If, after copying the terminating null wide character from src, count is not reached, additional null wide characters are written to dest until the total of count characters have been written.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Se le stringhe si sovrappongono, il comportamento non è definito.
Original:
If the strings overlap, the behavior is undefined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica] Parametri

dest -
puntatore alla matrice di caratteri estesi in cui copiare
Original:
pointer to the wide character array to copy to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
src -
puntatore alla stringa ampia da cui copiare
Original:
pointer to the wide string to copy from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
count -
il numero massimo di caratteri larghi da copiare
Original:
maximum number of wide characters to copy
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Valore di ritorno

dest

[modifica] Note

Nell'uso tipico, count è la dimensione della matrice di destinazione.
Original:
In typical usage, count is the size of 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.

[modifica] Esempio

#include <iostream>
#include <cwchar>
 
int main()
{
    wchar_t src[] = L"hi";
    wchar_t dest[6] = {L'a', L'b', L'c', L'd', L'e', L'f'};;
 
    std::wcsncpy(dest, src, 5); // this will copy hi and repeat \0 three times
 
    std::wcout << "The contents of dest are: ";
    for(wchar_t c : dest) {
        if(c)
            std::wcout << c << ' ';
        else
            std::wcout << "\\0" << ' ';
    }
    std::wcout << '\n';
}

Output:

The contents of dest are: h i \0 \0 \0 f

[modifica] Vedi anche

copia una stringa larga ad un altro
Original:
copies one wide string to another
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione) [edit]
copia un certo numero di caratteri estesi tra due matrici non si sovrappongono
Original:
copies a certain amount of wide characters between two non-overlapping arrays
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione) [edit]
C documentation for wcsncpy