随笔分类 -  常用函数

getline 函数
摘要:#include <bits/stdc++.h> #include <string> using namespace std; string s; int main() { getline(cin,s); cout<<s<<endl; /* fsw sf fsw sf */ cin>>s cout<<s<<endl; fsw sf fsw return 0; } 阅读全文

posted @ 2019-09-18 15:17 cltt 阅读(132) 评论(0) 推荐(0) 编辑

字符串函数
摘要:#include using namespace std; const int N = 1010; int main(){ char str[256] = { 0 };//str的大小(256)一定要填的。 int data = 1024; /* //将data转换为字符串 sprintf(str,"%d",data); cout #includ... 阅读全文

posted @ 2019-04-04 16:14 cltt 阅读(120) 评论(0) 推荐(0) 编辑

判断字符
摘要:判断字符变量c是否为字母或数字,若是则返回非零,否则返回零。 阅读全文

posted @ 2019-04-03 22:50 cltt 阅读(192) 评论(0) 推荐(0) 编辑

memset
摘要:只能是0 ,-1,0x3f3f3f3f (1e9) 阅读全文

posted @ 2018-08-30 13:17 cltt 阅读(105) 评论(0) 推荐(0) 编辑

unique
摘要:int a[8]={1,2,3,4,5}; int p=lower_bound(a,a+5,6)-a; cout<<p<<endl;//5 set<int>s; set<int>::iterator it; s.insert(3); s.insert(2); s.insert(1); s.inser 阅读全文

posted @ 2018-08-07 21:31 cltt 阅读(212) 评论(0) 推荐(0) 编辑

memcpy
摘要:1 #include 2 3 int main(void) 4 { 5 int a[5] = {1, 2, 3, 4, 5}, b[5]; 6 /*第一个参数是要保存的位置的起始地址,所以我们直接放b 7 *第二个参数是源数据的起始地址,所以我们把a放上去 8 *第三个参数是要复制的内存块的长度,为a的长度sizeof(a)*/ 9 ... 阅读全文

posted @ 2018-07-28 11:50 cltt 阅读(178) 评论(0) 推荐(0) 编辑

二进制
摘要:1 https://www.cnblogs.com/nysanier/archive/2011/04/19/2020778.html 2 3 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 using namespace ... 阅读全文

posted @ 2018-07-25 17:23 cltt 阅读(165) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示