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

📄 subject_21324.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:21324 发表者:xiangxing 发表日期:2002-11-15 23:03:38
<br>主题:盛请高手编一个与char *strcat(char *dest, const char *src)类似功能的函数
<br>内容:char *strcat(char *dest, const char *src)<BR>功能与上面的库函数相同只是把src的类型改为const char<BR>即为:<BR>char *youfun(char *dest, const char src) <BR> 
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:John Lan 回复日期:2002-11-15 23:11:11
<br>内容:你把src改造成 "src\0" 形式,call 一把 strcat 不就完了
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:xiangxing 回复日期:2002-11-15 23:15:29
<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>回复者:John Lan 回复日期:2002-11-15 23:26:47
<br>内容:// Copyright (c) dr0 &amp; singsky Software Inc.<BR>// All Rights Reserved by dr0(code) and singsky(idea)<BR>// 2002/11/15<BR>// :-)<BR><BR>char *new_style_strcat(char *dst, const char src)<BR>{<BR>&nbsp;&nbsp; char&nbsp;&nbsp;tail[2];<BR><BR>&nbsp;&nbsp; tail[0] = src;<BR>&nbsp;&nbsp; tail[1] = '\0';<BR> <BR>&nbsp;&nbsp; return strcat(dst, tail); <BR>}<BR><BR><BR>int main(int argc, char* argv[])<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;char buf[120];<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;char *p = buf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;buf[0] = '\0';<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;strcat(p, "hi, u are a lazy gu");<BR>&nbsp;&nbsp;&nbsp;&nbsp;new_style_strcat(p, 'y');<BR>&nbsp;&nbsp;&nbsp;&nbsp;printf("the words is: %s \n", p);<BR>&nbsp;&nbsp;&nbsp;&nbsp;return 0;<BR>}<BR><BR>2002-11-15 23:28:57

⌨️ 快捷键说明

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