//由于编译器版本原因strcpy出现不安全原因,导致无法运行,后使用strcpy_s给予拷贝长度得到解决;把“==”写成“=”导致报错;/*输入字符串统计字符个数(权值)int CreateWeightArray(char* str, int* Array) { //初始化权值数组,128为str ...
分类:
编程语言 时间:
2019-05-02 11:52:16
阅读次数:
296
头文件:#include <string.h>定义函数:char *strcpy(char *dest, const char *src);函数说明:strcpy()会将参数src 字符串拷贝至参数dest 所指的地址。返回值:返回参数dest 的字符串起始地址。附加说明:如果参数 dest 所指的 ...
分类:
编程语言 时间:
2019-04-26 22:55:24
阅读次数:
279
为什么构造函数里必须要加const,猜测是因为"aaa"是一个常量,待解决 ...
分类:
其他好文 时间:
2019-04-25 13:15:30
阅读次数:
126
#include #include using namespace std; int main() { string str1 = "hello"; string* str2 = new string("hello"); string str3 = "world"; //获取字符串长度 int le... ...
分类:
其他好文 时间:
2019-04-09 00:14:59
阅读次数:
130
高精度计算 由于C++储存的最大整数是 long long 类型的,2^63左右,可是如果我们要计算的数超过了这个范围,那就会爆了,是时候引入高精度计算了。 高精度计算要把需要运算的数转化为字符串读入,否则会炸 高精度加法 思路:模拟竖式计算 注意:(1)进位 (2)倒序计算 高精度减法 思路:模拟 ...
分类:
其他好文 时间:
2019-04-04 20:25:06
阅读次数:
145
参考:www.cnblogs.com/carsonzhu/p/5277036.html 字符串拷贝函数strcpy的原型: char *strcpy(char *strDest,const char *strSrc); strcpy函数将strSrc拷贝至输出参数strDest中,同时函数的返回值又 ...
分类:
其他好文 时间:
2019-04-03 20:42:30
阅读次数:
163
1.数组 由具体详相同数据类型的数据元素按照一定顺序排列而成的集合,由字符数组、常量数组、实数数组和指针数组等。 1.1一维数组 1.2多维数组 1.3字符数组和字符串 2.指针 2.1指针的概念 指针:存放变量、数组与函数等的内存地址; 指针变量:存放内存地址(即指针)的变量; 作用:提供一种间接 ...
分类:
编程语言 时间:
2019-03-21 21:39:45
阅读次数:
198
main.c 文件 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include "myls.h" 8 9 void stat_attbute(struct stat *buf); 10 int is_not... ...
分类:
其他好文 时间:
2019-03-16 12:53:14
阅读次数:
131
一. strcmp strcmp是用于比较两个字符串的大小的。 int strcmp( const char *string1, const char *string2 ) char *string1 = "abcd"; char *string2 = "abfdhjt"; 就像上面两个字符串,st... ...
分类:
其他好文 时间:
2019-03-13 20:07:51
阅读次数:
118
//1.实现strcpy. //2.实现strcat. ...
分类:
编程语言 时间:
2019-03-07 11:37:16
阅读次数:
170