码迷,mamicode.com
首页 >  
搜索关键字:strcpy strncpy    ( 1000个结果
基类指针引用派生类对象
#include<iostream>#include<cstring>usingnamespacestd;classA{ charname[20];public: voidput_name(char*n){strcpy_s(name,n);} voidget_name()const{ cout<<name<<endl; };};classB:publicA{ charnum[20];public: voidput_num(char*n){strcpy_s(nu..
分类:其他好文   时间:2017-04-18 20:06:56    阅读次数:144
【转】C Runtime Library的来历
由于我看到的文章也是转载且未提供原文链接,所以这里没有提供原文链接! msvcrt.dll(名称:Microsoft C Runtime Library)提供了printf,malloc,strcpy等C语言库函数,并且为使用C/C++(VC)编译的程序提供了初始化(如获取命令行参数)以及退出等功能 ...
分类:其他好文   时间:2017-04-14 16:33:44    阅读次数:128
strcpy在centos6.x,gcc4.4.7版本上会有bug,自我移动导致覆盖错误overlap
Gcc编译时无优化参数,以前曾经被-O坑过。#include<stdio.h> #include<string.h> intmain() { charurl[512]; sprintf(url,"218.26.242.56/0/0/1023/6d6168bf1a7294ae0e1c071171adcd48.mp4"); printf("%s\n",url); char*p=url; strcpy(p+15,p+22); printf("%s\n",..
分类:移动开发   时间:2017-04-14 10:45:50    阅读次数:528
POJ2166 Death to Binary?
1 /* 2 POJ2166 Death to Binary? 3 http://poj.org/problem?id=2116 4 齐肯多夫定理 5 6 */ 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include ... ...
分类:其他好文   时间:2017-04-12 13:28:24    阅读次数:223
自定义实现拷贝构造函数
String::String(const String &other){ // 得分点:输入参数为const型 int length = strlen(other.m_data); m_data = new char[length+1]; //加分点:对m_data加NULL 判断 strcpy(m ...
分类:其他好文   时间:2017-04-12 04:36:56    阅读次数:145
自定义实现strcpy函数原型
char *strcpy(char *strDest, const char *strSrc){ if ( strDest == NULL || strSrc == NULL) return NULL ; if ( strDest == strSrc) return strDest ; char * ...
分类:其他好文   时间:2017-04-12 04:36:01    阅读次数:149
重载加法运算符
#include<stdio.h>#include<string.h>class String{ public: String(const char *str = NULL); char *m_data; char *addstr; String &operator + (const String ...
分类:其他好文   时间:2017-04-12 04:34:40    阅读次数:216
strcpy实现
#include #include using namespace std; void* my_memcpy(void* dest,const void* src,unsigned int count) { if (dest == NULL || src == NULL) { return NULL... ...
分类:其他好文   时间:2017-04-11 09:19:49    阅读次数:177
抄写作业
总结:C语言是极易弄错误的一门课,因此需要我们细心查看,要注意标点括号,要查阅出错时程序给的错误提示,并思考出现这种错误的原因,然后逐 层修改。 ...
分类:其他好文   时间:2017-04-08 16:08:12    阅读次数:269
结构体
#define _CRT_SECURE_NO_WARNINGS #include #include typedef struct Peo { int age; char name[32]; }peo; void copy1(peo *obj1, peo *obj2) { *obj1 = *obj2;... ...
分类:其他好文   时间:2017-04-06 15:29:27    阅读次数:125
1000条   上一页 1 ... 36 37 38 39 40 ... 100 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!