doc/tutorial-zh-cn: Fix a typo in tutorial

This commit is contained in:
Andy Deng 2016-06-15 11:53:23 +08:00
parent 6f5e83db04
commit 2246ef3e6b

View File

@ -379,7 +379,7 @@ const char * cstr = getenv("USER");
size_t cstr_len = ...; // 如果有长度 size_t cstr_len = ...; // 如果有长度
Value s; Value s;
// s.SetString(cstr); // 这不能通过编译 // s.SetString(cstr); // 这不能通过编译
s.SetString(StringRef(cstr)); // 可以,假设它的生命周期全,并且是以空字符结尾的 s.SetString(StringRef(cstr)); // 可以,假设它的生命周期全,并且是以空字符结尾的
s = StringRef(cstr); // 上行的缩写 s = StringRef(cstr); // 上行的缩写
s.SetString(StringRef(cstr, cstr_len));// 更快,可处理空字符 s.SetString(StringRef(cstr, cstr_len));// 更快,可处理空字符
s = StringRef(cstr, cstr_len); // 上行的缩写 s = StringRef(cstr, cstr_len); // 上行的缩写