www.digitalmars.com         C & C++   DMDScript  

c++ - String Streams in Hybrid C/C++ Win16 App

reply Mark Evans <mevans zyvex.com> writes:
Is it possible to build a Win16 app in C with single object module in C++ that
performs stream i/o on string buffers (strstream).  The app is a WINIO app
which 
does have some effects on printf and other calls.  But it should be possible to
set up a strstream object in separate .cpp files.

Mark
May 11 2001
next sibling parent Jan Knepper <jan smartsoft.cc> writes:
Sure!
It's basically a matter of compiling things the right way and making sure the
compiler understand what is C and what is C++ code.

Many times with ancient projects I have just renamed .C files to .CPP and
compiled them as C++ programs while the .CPP files basically only contain C
coded source.

You might have to put some stuff between
#ifdef __cplusplus
extern "C" {
#endif

// C-stuff

#ifdef __cplusplus
}
#endif

To make sure certain prototypes etc, don't get mangled.

Don't worry, be Kneppie!
Jan



Mark Evans wrote:

 Is it possible to build a Win16 app in C with single object module in C++ that
performs stream i/o on string buffers (strstream).  The app is a WINIO app which
 does have some effects on printf and other calls.  But it should be possible
to set up a strstream object in separate .cpp files.

 Mark

May 11 2001
prev sibling parent "Walter" <walter digitalmars.com> writes:
I don't see any reason why it shouldn't be possible.

Mark Evans wrote in message <1103_989602360 evans>...
Is it possible to build a Win16 app in C with single object module in C++

app which
does have some effects on printf and other calls.  But it should be

Mark

May 11 2001