⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_22829.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:22829 发表者:随缘 发表日期:2002-11-28 17:25:23
<br>主题:一个有趣的问题
<br>内容: CEdit* pEdit1 = (CEdit*)GetDlgItem(IDC_EDIT1); <BR> pEdit1-&gt;GetWindowText(content1); <BR>我通过以上语句获得了CEdit里面的内容,然后想用下面的语句取出单个字符 <BR> char ch; <BR> ch=content1.GetAt(i)&nbsp;&nbsp;&nbsp;&nbsp;; <BR>程序可以通过编译,但是运行时,操作系统显示程序运行错误,然后我的程序就被 <BR>关闭了。各位高手,这是什么原因啊?我该怎么办啊? <BR><BR>&nbsp;&nbsp;<BR> <BR> 
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:PLB 回复日期:2002-11-28 18:07:54
<br>内容:程序运行到<BR>ch=content1.GetAt(i)&nbsp;&nbsp;&nbsp;&nbsp;;<BR>这条语句时,编辑框里有内容么?或者有第i个字符么?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:随缘 回复日期:2002-11-28 18:15:47
<br>内容:哦,第i个字符是有的。在ch=content1.GetAt(i)这句之前有这样一句话for (i=1,i&lt;content1.GetLength(),i++){<BR>........<BR>ch=content1.GetAt(i)<BR>.......<BR>}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:我本大梦人 回复日期:2002-11-28 18:49:44
<br>内容:想得content1中的单个字符,可以这样做:<BR>char * ch;<BR>for (int i=0;i&lt;content1.GetLength();i++)<BR>{<BR>ch[i]=content1[i];<BR>}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -