libraries and STL versions

I

Ian Lazarus

Greetings and felicitations,

I need to write a class which will be part of a library. The class is
exposed to users of the library. The class needs to provide strings (only
char and wchar_t) to its users. The data in the strings is not known until
run time. The version of the STL which the class is compiled with won't
necessarily be the same version which users of the library will compile
with. So how can it provide strings to its users?

Thanks
 
J

Jack Klein

Greetings and felicitations,

I need to write a class which will be part of a library. The class is
exposed to users of the library. The class needs to provide strings (only
char and wchar_t) to its users. The data in the strings is not known until
run time. The version of the STL which the class is compiled with won't
necessarily be the same version which users of the library will compile
with. So how can it provide strings to its users?

Thanks

The <cstdlib> functions std::malloc(), std::calloc(), std::realloc(),
and std::free() are all part of ISO standard C++ and are completely
independent of any C++ features in the library. When properly used,
they can certainly provide for management of C strings and wide
strings.
 
M

Mike Wahler

Ian Lazarus said:
Greetings and felicitations,

I need to write a class which will be part of a library. The class is
exposed to users of the library. The class needs to provide strings (only
char and wchar_t) to its users. The data in the strings is not known until
run time. The version of the STL which the class is compiled with won't
necessarily be the same version which users of the library will compile
with. So how can it provide strings to its users?

I would define members as type 'std::string' from standard
header <string>, connecting them with interfaces that
provide the desired services.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top