[SunHELP] Help, a programming problem

Lyndon Griffin sunhelp at sunhelp.org
Tue Jun 5 12:43:57 CDT 2001


C++ allows you to specify <strstream> instead of <strstream.h>, and is not
specific to that subset of functions.  Do be careful, however, when
selecting one or the other because they may not be the same.  It is also
important to select your namespace when using Sun compilers (there is a
section on this in the release notes for the Workshop 5 suite).  You
can either declare the namespace globally, as in:

namespace std;

or on an instance-by-instance basis, such as:

std::strstream str;

For most routine applications, it is sufficient to declare

using namespace std;

in one of your header files as a preprocessor conditional, like so:

#ifdef USING_SUN_PRO_5
using namespace std;
#endif //def USING_SUN_PRO_5

-- 
<:)  Lyndon Griffin
     Sr. Systems Engineer
     Naviant (http://www.naviant.com/)

PGP Public Key:  http://bsd4us.org/~lyndon/b/lyndon.pgp

On Tue, 5 Jun 2001, Jon Still wrote:

>
> > and locked in the constrction. But, this program runs in Solaris
> > 2.6 fine.
> >     source listed below:
> >
> >     #include <strstream>
>
> Surely that should be #include <strstream.h> ?
>
> Also try something like find / -name strstream.h -print to see where the
> file is installed on your system.  You might need to pass extra include
> directories to g++ with -I (I think).
>
> Jon.
>
> --
> Jon Still                               E-mail: jon at tertial.org
> System Administrator                    Web:    http://www.tertial.org/
> tertial.org
>
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp
>




More information about the SunHELP mailing list