About 661,000 results
Open links in new tab
  1. c++ - How do I include the string header? - Stack Overflow

    That header is for the C functions for manipulating null-terminated arrays of characters, also known as C-style strings. In C++, you should use the string header. Write #include <string> at …

  2. c++ - How to import/ include string in cpp - Stack Overflow

    Apr 10, 2019 · In C++ the using statement is not related to including the functionality of that namespace (or type). Instead, it allows you to use the namespace in the statement without a …

  3. When do I use '#include <string>' at the start of a C++ program?

    Dec 8, 2014 · I am confused about the use of #include <string> at the start of a program. For example, in the code below, I don't use #include <string> but the function will still print out the …

  4. where do i include the string library in my C++ header file

    Sep 16, 2011 · My simple class won't compile in Visual Studio. It worked before I added the string company member and the getter method getCo() to it. I think I need to put #include the string …

  5. c++ - What is the difference between "using std::string" and …

    Sep 7, 2022 · You need to include the <string> header to use std::string. Adding using std::string; allows you to use it without the std:: namespace qualifier. If you include a header that includes …

  6. Do I have to use #include <string> beside <iostream>?

    May 12, 2013 · Do I have to include the <string> header when I want to use the string type if I included the <iostream> header? Yes, you have to. You cannot rely on relevant headers (e.g. …

  7. c++ - include string or string.h - Stack Overflow

    <string> is a C++ standard library include, and <string.h> is C standard library include. The equivalent of <string.h> in C++ is <cstring>, although both will work. The difference is: …

  8. c++ - Can std::string be used without #include <string>? - Stack …

    Oct 26, 2015 · If you want to use std::string, you should always #include <string>, otherwise your program might not run on different implementations, or even in later versions of your current one.

  9. "#include" a text file in a C program as a char[] - Stack Overflow

    Jan 4, 2009 · So basically having a C or C++ style string in a text file that you include. It would make the code neater because there isn't this huge lot of text at the start of the file.

  10. c++ - Why we should import #include <string> for string data …

    Apr 30, 2019 · Because string operations are more complex compared to operations with primitive types like int and float, std::string is provided as a C++ standard library container like …