随笔分类 -  常用函数

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 阅读(138) 评论(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 阅读(130) 评论(0) 推荐(0)

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

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

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

posted @ 2018-08-30 13:17 cltt 阅读(114) 评论(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 阅读(218) 评论(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 阅读(184) 评论(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 阅读(173) 评论(0) 推荐(0)

导航