![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++编程
文章平均质量分 61
Bald_computer
这个作者很懒,什么都没留下…
展开
-
CCF历年题目解析C++实现(简单题)2013-2022
CCF历年题目解析(简单题)2013-2022原创 2023-03-09 08:52:23 · 319 阅读 · 2 评论 -
C++头文件cstring和string区别。
cstring为C-风格string类头文件。string为C++风格string类头文件。原创 2019-03-01 19:47:30 · 2854 阅读 · 4 评论 -
VS2017中部分字符串函数安全性的更改。
str1 = str2; strcpy_s(charr1, charr2); str1 += " paste"; strcat_s(charr1, " juice");为了安全性考虑,在VS2017中将strcpy与strcat改为strcpy_s与strcat_s。摘自百度百科摘自百度百科。...原创 2019-03-01 19:58:33 · 637 阅读 · 2 评论 -
strcpy_s格式规范。
char animal[20] = "bear";char * ps;ps = animal;ps = new char[strlen(animal) + 1];strcpy_s(ps, strlen(animal) + 1, animal);//strlen(animal) + 1表示缓冲区域大小,若输入的animal为fox,则次缓冲区域设置为4就可以了。若设置原创 2019-03-03 17:59:21 · 954 阅读 · 1 评论 -
strcmp函数比较顺序等用法
函数原型:strcmp(const char *s1,const char *s2);比较用法:当s1<s2时,返回为负数;当s1==s2时,返回值= 0;当s1>s2时,返回正数。即:两个字符串自左向右逐个字符相比(按ASCII值大小相比较),直到出现不同的字符或遇’\0’为止。比较输入字符串顺序用法:int main(){ using namespace st...原创 2019-03-10 15:46:05 · 2643 阅读 · 0 评论 -
条件运算符嵌套
const char x[2] [20] = {"Jason","at your services\n"} const char * y = "Quillstone"; for(int i = 0; i <3; i++) cout<<((i < 2)? !i ? x[i] : y : x[1]);...转载 2019-03-10 16:44:04 · 261 阅读 · 0 评论 -
未理解的编写延时循环
#include<iostream>#include<ctime> //typedef long clock_tint main(){ using namespace std; cout << "Enter the delay time, in seconds: "; float secs; cin >> secs;...原创 2019-03-07 20:07:48 · 188 阅读 · 0 评论