String class

Hi
will someone take pity on me and give an example of how to get a c string
back from a String

The manual says use String::operator char const *()

Does that mean for String s i use (char const *)s to get the c string
(like c_str() in other variants of c++).

TIA
Steve

Yes, doing (const char *)s would return the c string you want.

A problem I have now is I’m thinking of porting my code to another OS. The
main issue is I have used many Watcom libraries that aren’t very portable.
I’m thinking of getting STL for QNX and changing my code over to use that
instead, so I reduce a major headache when it comes time to porting (plus
it’s more widely used than Watcom’s STL-type libraries). But that’s only my
issue, it might help you to try the same so the learning curve is also less
(only have to know 1 set of commands instead of 2 or maybe more).


“Stephen F Terrell” <stephen@trsystem.demon.co.uk> wrote in message
news:9c7j4p$h1a$1@inn.qnx.com

Hi
will someone take pity on me and give an example of how to get a c string
back from a String

The manual says use String::operator char const *()

Does that mean for String s i use (char const *)s to get the c string
(like c_str() in other variants of c++).

TIA
Steve