GetDlgItemText API函数取得的字符最后一位是空字节?
时间:2011-12-09
来源:互联网
为什么GetDlgItemText API函数取得的字符最后一位是空字节,这样定义定义变量长度的时候就必须比实际输入的字符长度要多一位是不是。
作者: lenceliu 发布时间: 2011-12-09
兄弟,这里是汇编。
不过我觉得你说的很正确。个人意见,请参考^_^
不过我觉得你说的很正确。个人意见,请参考^_^
作者: PointertoPointer 发布时间: 2011-12-09
lpString
[out] Pointer to the buffer to receive the title or text.
nMaxCount
[in] Specifies the maximum length, in TCHARs, of the string to be copied to the buffer pointed to by lpString. If the length of the string, including the NULL character, exceeds the limit, the string is truncated.
If the string is as long or longer than the buffer, the buffer will contain the truncated string with a terminating NULL character.
c风格的字符串是以'\0'结尾的,所以假如字符串长度是10字节,实际上是11字节,最后有个'\0'
[out] Pointer to the buffer to receive the title or text.
nMaxCount
[in] Specifies the maximum length, in TCHARs, of the string to be copied to the buffer pointed to by lpString. If the length of the string, including the NULL character, exceeds the limit, the string is truncated.
If the string is as long or longer than the buffer, the buffer will contain the truncated string with a terminating NULL character.
c风格的字符串是以'\0'结尾的,所以假如字符串长度是10字节,实际上是11字节,最后有个'\0'
作者: cnfixit 发布时间: 2011-12-09
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28