summaryrefslogtreecommitdiff
path: root/example/tutorial/tutorial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'example/tutorial/tutorial.cpp')
-rw-r--r--example/tutorial/tutorial.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/example/tutorial/tutorial.cpp b/example/tutorial/tutorial.cpp
index 206fdb9..354057a 100644
--- a/example/tutorial/tutorial.cpp
+++ b/example/tutorial/tutorial.cpp
@@ -121,17 +121,17 @@ int main(int, char*[]) {
// This version of SetString() needs an allocator, which means it will allocate a new buffer and copy the the string into the buffer.
Value author;
{
- char buffer[10];
- int len = sprintf(buffer, "%s %s", "Milo", "Yip"); // synthetic example of dynamically created string.
+ char buffer2[10];
+ int len = sprintf(buffer2, "%s %s", "Milo", "Yip"); // synthetic example of dynamically created string.
- author.SetString(buffer, static_cast<size_t>(len), document.GetAllocator());
+ author.SetString(buffer2, static_cast<SizeType>(len), document.GetAllocator());
// Shorter but slower version:
// document["hello"].SetString(buffer, document.GetAllocator());
// Constructor version:
// Value author(buffer, len, document.GetAllocator());
// Value author(buffer, document.GetAllocator());
- memset(buffer, 0, sizeof(buffer)); // For demonstration purpose.
+ memset(buffer2, 0, sizeof(buffer2)); // For demonstration purpose.
}
// Variable 'buffer' is unusable now but 'author' has already made a copy.
document.AddMember("author", author, document.GetAllocator());