This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sstream (probably revisited)



Um. If possible, please post in plain text.

The following fixed code works as you expect:

//#include <strstream>
#include <sstream>
#include <iostream>

int main()
{
  //  std::ostringstream oss;
  std::stringstream oss;
  std::string s = "1235";
  oss << s;
  long l = 0;
  oss >> l; // xxx no operator >> long for ostream
  std::cout << l << std::endl;
  
  return 0;
}

// should output: 1235
// current output: 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]