STL标准模版库
string
  • 可以通过printf输出

    1
    2
    string str = "abcd";
    printf("%s\n",str.c_str())
  • It can use operator ‘+’ to add two string variable

    1
    2
    stirng str1 = "abc", str2 = "xyz", str3;
    str3 = str1 + str2;

-Two string type variables can be directly compared using ==, <>, and the comparison rule is alphabet order.

1
2
3
stirng str1 = "abc", str2 = "xyz";
if(str2>str1) printf("OK!\n");
// The result is the "OK!" will be print.
Author: Vallzey
Link: https://vallzey.github.io/2018/08/09/STL标准模版库/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.