strdup函数
函数原型:extern char *strdup(char *str)
参数说明:str待复制的字符串。
所在库名:#include <string.h>
函数功能:实现复制字符串str。
返回说明:返回复制的新字符串的指针,复制失败返回NULL。
其它说明:暂时无。
实例:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
在VC++ 6.0编译运行:
复制字符串str成功。
Keep it simple!
函数原型:extern char *strdup(char *str)
参数说明:str待复制的字符串。
所在库名:#include <string.h>
函数功能:实现复制字符串str。
返回说明:返回复制的新字符串的指针,复制失败返回NULL。
其它说明:暂时无。
实例:
在VC++ 6.0编译运行:
复制字符串str成功。