How do I include the string header?

后端 未结 9 1160
旧时难觅i
旧时难觅i 2020-12-05 10:01

I\'m trying to learn about strings, but different sources tell my to include different headers.

Some say to use , but other

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 10:05

    You want to include and use std::string:

    #include 
    #include 
    
    int main()
    {
        std::string s = "a string";
        std::cout << s << std::endl;
    }
    

    But what you really need to do is get an introductory level book. You aren't going to learn properly any other way, certainly not scrapping for information online.

提交回复
热议问题