diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index ef694f749699a4bad9ee3d63c1f0f56641c546bb..cdf2c8cf907b1446dd094369d63d5f0b7428b527 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1001,6 +1001,13 @@ class FlatBufferBuilder { return CreateString(str, strlen(str)); } + /// @brief Store a string in the buffer, which is null-terminated. + /// @param[in] str A char pointer to a C-string to add to the buffer. + /// @return Returns the offset in the buffer where the string starts. + Offset<String> CreateString(char *str) { + return CreateString(str, strlen(str)); + } + /// @brief Store a string in the buffer, which can contain any binary data. /// @param[in] str A const reference to a std::string to store in the buffer. /// @return Returns the offset in the buffer where the string starts.