📄 subject_35398.htm
字号:
<p>
序号:35398 发表者:夏乾坤 发表日期:2003-04-06 16:16:33
<br>主题:strcat菜鸟问题
<br>内容:已知<BR><BR>LPCTSTR path="System\\CurrentControlSet\\Services\\Class\\NetTrans\\";<BR><BR>CString str = "0002"<BR><BR>如何将str 的内容合并到 Lpctstr 中?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:Justin Le 回复日期:2003-04-06 17:35:28
<br>内容:/*LPCTSTR A 32-bit pointer to a constant character string that is portable for Unicode and DBCS.<BR>因此你不能试图修改 lpcstr定义的变量 比如下面这个例子<BR>*/<BR>#include <stdio.h><BR>#include <afxdisp.h><BR> <BR>void main()<BR>{<BR> LPCTSTR str="1111";<BR> //strcpy(str,"2222"); //去掉注释,你就会发现错误<BR> printf("%s",str);<BR><BR>}<BR><BR>//你可以将LPCSTR定义改为CString 或LPSTR, 再付值<BR><BR>2003-4-6 17:40:18
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -