
c++
Donric-Yee
想过高配版的生活,自己的要求就别太低。
展开
-
【转】memset()不能初始化为1
#include <stdio.h> #include <string.h> int main() { int array[5]; int a; while(~scanf("%d",&a)){ memset(array,a,sizeof(array)); printf("%d %d\n",a...原创 2020-03-09 22:08:08 · 837 阅读 · 2 评论 -
【C++】string详解
【C++】string详解我们再使用再对字符串操作的时候,可以调用string中的函数实现一些功能,string的头文件是#include<string>string类是一个模板类,位于名字空间std中,所以还需要using namespace std;字符串构造函数string str; // 构造空的string类对象strstring str(“abc...原创 2020-03-05 00:58:22 · 1291 阅读 · 0 评论 -
【C++】cmath文件名详解
【C++】cmath文件名详解cmath是c++语言中的标准库头文件。其中的 “c” 表示其中的函数是来自 C标准库,“math”表示为数学常用库函数。该头文件主要声明了常用的数学库函数,比如三角函数相关,常用数学运算相关的一些基本函数。其使包含math.h的头文件。绝对值函数int abs(int i) 返回整型参数i的绝对值double fabs(double x) 返回双精度参数x...原创 2020-02-23 13:57:34 · 5094 阅读 · 1 评论 -
C++二维数组动态分配内存
//动态分配char **a;a = new char* [m];//分配指针数组for(int i=0; i<m; i++)a[i] = new char[n];//分配每个指针所指向的数组//删除内存for(i=0; i<m; i++)delete[] a[i];delete[] a;...原创 2020-02-20 13:46:43 · 789 阅读 · 0 评论