◐ Shell
clean mode source ↗

std::basic_string::copy – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

size_type copy( CharT* dest, size_type count, size_type pos = 0);

Kopiert einen Teilstring [pos, pos+count) eine Zeichenkette, auf die dest. Wenn die angeforderte Teilzeichenkette reicht über das Ende des Fadens, oder wenn count == npos ist die kopierten Teilzeichenkette [pos, size()). Die resultierende Zeichenkette ist nicht null-terminierte .

Original:

Copies a substring [pos, pos+count) to character string pointed to by dest. If the requested substring lasts past the end of the string, or if count == npos, the copied substring is [pos, size()). The resulting character string 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.

Wenn pos >= size() wird std::out_of_range geworfen .

Original:

If pos >= size(), std::out_of_range is thrown.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parameter

dest -

Zeiger auf den Ziel-Zeichenkette

Original:

pointer to the destination character string

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

pos -

Position des ersten Zeichens umfassen

Original:

position of the first character to include

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

count -

Länge der Teilzeichenfolge

Original:

length of the substring

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Rückgabewert

Anzahl der kopierten Zeichen

Original:

number of characters copied

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Ausnahmen

std::out_of_range if pos >= size().

Komplexität

linear in count

Original:

linear in count

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Beispiel

Siehe auch

liefert einen Teilstring

Original:

returns a substring

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(öffentliche Elementfunktion) [edit]