strstream not found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perhiyar
    New Member
    • Jan 2008
    • 5

    #1

    strstream not found

    #include <iostream>
    #include <string>
    #include <vector>
    #include <strstream>
    using namespace std;

    At line 4, i am geeting error

    warning This file includes at least one deprecated or antiquated header. \
    Please consider using one of the 32 headers found in section 17.4.1.2 of the \
    C++ standard. Examples include substituting the <X> header for the <X.h> \
    header for C++ includes, or <iostream> instead of the deprecated header \
    <iostream.h>. To disable this warning use -Wno-deprecated.

    and please explanin what this line means in code

    <!--[if !supportEmptyPa ras]--> <!--[endif]-->

    With Regards
    Parhiyar
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    strstream is deprecated.

    You should be using sstream instead.

    Originally posted by perhiyar
    <!--[if !supportEmptyPa ras]--> <!--[endif]-->
    Let's see the entire line of code and maybe a line or two abiove and below.

    Comment

    • perhiyar
      New Member
      • Jan 2008
      • 5

      #3
      I have replaced strstream with sstream but now got only one error in the following loop:

      int search_count = 0;
      for (int i=0; i<100000; i++) {
      sstream stm;
      stm << i;
      stm >> search_vect[search_count++];
      }

      Error: sstream undeclared (First use this function)
      (Each undeclared identifier is reported only once for each function it appears in)

      Comment

      • oler1s
        Recognized Expert Contributor
        • Aug 2007
        • 671

        #4
        I have replaced strstream with sstream
        Why? Where did you get the idea of sstream? Do you even look at documentation?

        It's stringstream. Seriously, read documentation. Don't complain when your guesses fail miserably.

        Comment

        • perhiyar
          New Member
          • Jan 2008
          • 5

          #5
          i am doing simulation in NS2 for sensor networks , for query processing i have to implement B-tree

          I just copy B-tree code from wiki pedia

          but i am getting error in this loop right at the end of 1500 lines codes, so i am completly confuse what to do, i have searched through Documentation and found some information but unable to fix it

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            Did you #include <sstream> ??

            Better read up on stringstream.

            Comment

            Working...