【C++ 】string类常见用法总结,超有用,算法竞赛必备
1.头文件#include<string.h>2.构造函数string s1(); // si = ""string s2("Hello"); // s2 = "Hello"string s3(4, 'K'); // s3 = "KKKK"string s4("12345", 1, 3); //s4 = "234",即 "1234