1.define头文件打标记用法
#include<bits/stdc++.h> #define de(x) cout<<#x<<"="<<x<<endl using namespace std; int main() { string a="hello kate"; de(a); return 0; }
2.string.push_back()
在尾部插入元素,直接+增长字符串,遇到加多个值,或者加int等不是字符类型的会有问题,这时直接push_back,干脆利落
1.define头文件打标记用法
#include<bits/stdc++.h> #define de(x) cout<<#x<<"="<<x<<endl using namespace std; int main() { string a="hello kate"; de(a); return 0; }
2.string.push_back()
在尾部插入元素,直接+增长字符串,遇到加多个值,或者加int等不是字符类型的会有问题,这时直接push_back,干脆利落