Thread: VC++ 6.0 and #include<sstring>

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663

    VC++ 6.0 and #include<sstring>

    I was trying to use the stringstream class to convert numbers to strings, and I got an error saying the <sstream> file could not be found:
    Code:
    #include<iostream>
    #include<string>
    #include<sstring>
    
    using namespace std; 	
    
    int main()
    {
    
    	string data;
    	ostringstream outStr(data);
    
    	//Data to be converted to a string:
    	int num1= 50;
    	double num2 = 123.6;
    
    	outStr<<num1<<" "<<num2<<" ";
    	cout<<data<<endl;
    
    	return 0;
    }
    C:\Beginning C++\test\test.cpp(3) : fatal error C1083: Cannot open include file: 'sstring': No such file or directory

  2. #2
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    try

    Code:
    #include <csstring>

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    <csstring> doesn't work. <sstring> is supposed to be the standard C++ ANSI name.

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    ...ooops <sstring> ===> <sstream>

  5. #5
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    o well it was jus a guess.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. makefile exported by vc 6.0 doesn't work
    By wow in forum Windows Programming
    Replies: 7
    Last Post: 03-24-2006, 04:20 PM
  2. Can't compile this with VC 6.0
    By uriel2013 in forum C++ Programming
    Replies: 4
    Last Post: 05-31-2003, 07:43 PM
  3. Visual Studio 6.0 Help
    By L_I_Programmer in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2003, 10:35 PM
  4. adding a header file in VC 6.0
    By stimpyzu in forum C++ Programming
    Replies: 5
    Last Post: 10-28-2002, 02:26 AM
  5. VC 6.0 compiled error
    By alan4100 in forum Windows Programming
    Replies: 4
    Last Post: 09-17-2001, 03:10 PM