TCString::Strncpy

Copy a string with length checking. Behavior differs from strncpy in that last character is zeroed.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/CString.h

Include

#include "Misc/CString.h"

Syntax

static CharType * Strncpy
(
    CharType * Dest,
    const CharType * Src,
    int32 MaxLen
)

Remarks

Copy a string with length checking. Behavior differs from strncpy in that last character is zeroed.

Returns

pointer to resulting string buffer

Parameters

Parameter

Description

Dest

destination buffer to copy to

Src

source buffer to copy from

MaxLen

max length of the buffer (including null-terminator)