🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Steve F. Cipolli Fri, 18 Aug 1995 06:51
basic_string conversions
#1735
Author: Steve F. Cipolli
Date: Fri, 18 Aug 1995 06:51
24 lines
1232 bytes
Distribution:
What is the recommended method of converting basic_string's of one 
parameterized type to another, and from another parameterized type itself.  
To clarify:

char *ntbs = "abc";
wchar_t *ntcws = L"abc";
string cs(ntbs);	// basic_string<char>(char *) - OK
wstring ws1(ntcws);	// basic_string<wchar_t>(wchar_t *) - OK
wstring ws2(ntbs);	// basic_string<wchar_t>(char *) - ???? 
wstring ws3(cs);	// basic_string<wchar_t>(basic_string<char>) - ???? 

Will the last two constructors work.  If so how?
If not, is the <cwchar> conversion function btowc from the C libray the answer?

Stephen Cipolli
Datascope Corp.
sfc@datascope.com


---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads