Click here to Skip to main content
14,325,629 members

ATL / WTL / STL

 
GeneralRe: STL std::string help needed Pin
Jochen Arndt9-Feb-17 23:35
mveJochen Arndt9-Feb-17 23:35 
PraiseRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 23:53
professionalVISWESWARAN19989-Feb-17 23:53 
PraiseRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 23:07
professionalVISWESWARAN19989-Feb-17 23:07 
AnswerRe: STL std::string help needed Pin
Jochen Arndt8-Feb-17 22:29
mveJochen Arndt8-Feb-17 22:29 
GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 4:00
professionalVISWESWARAN19989-Feb-17 4:00 
GeneralRe: STL std::string help needed Pin
Jochen Arndt9-Feb-17 4:12
mveJochen Arndt9-Feb-17 4:12 
GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 19:52
professionalVISWESWARAN19989-Feb-17 19:52 
AnswerRe: STL std::string help needed Pin
Daniel Pfeffer9-Feb-17 6:17
professionalDaniel Pfeffer9-Feb-17 6:17 
Inside your program, the best way to represent characters is using the wchar_t-based types (e.g. std::wstring). This enables simple processing (all characters are represented by a single wchar_t value), and so on.

If you wish to call a library that only supports char-based types (e.g. std::string), you must convert whar_t types to char type, call the library, and convert the results back. In C++11, the standard way to do this is something like this:
#include <locale>
<h1>include <codecvt></h1>

<h1>include <string></h1>

std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;

std::wstring wide_source;
std::string narrow_target = converter.to_bytes(wide_source);

std::string narrow_source;
std::wstring wide_target = converter.from_bytes(narrow_source);
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.

--Winston Churchill

GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 7:27
professionalVISWESWARAN19989-Feb-17 7:27 
GeneralRe: STL std::string help needed Pin
Daniel Pfeffer11-Feb-17 7:36
professionalDaniel Pfeffer11-Feb-17 7:36 
QuestionRe: STL std::string help needed Pin
VISWESWARAN199812-Feb-17 0:18
professionalVISWESWARAN199812-Feb-17 0:18 
AnswerRe: STL std::string help needed Pin
Daniel Pfeffer12-Feb-17 0:47
professionalDaniel Pfeffer12-Feb-17 0:47 
PraiseRe: STL std::string help needed Pin
VISWESWARAN199812-Feb-17 4:25
professionalVISWESWARAN199812-Feb-17 4:25 
PraiseRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 23:54
professionalVISWESWARAN19989-Feb-17 23:54 
QuestionMultiple Inheritance question Pin
samzcs25-Dec-16 17:31
membersamzcs25-Dec-16 17:31 
GeneralRe: Multiple Inheritance question Pin
Richard MacCutchan25-Dec-16 20:36
protectorRichard MacCutchan25-Dec-16 20:36 
GeneralRe: Multiple Inheritance question Pin
samzcs26-Dec-16 7:51
membersamzcs26-Dec-16 7:51 
GeneralRe: Multiple Inheritance question Pin
Richard MacCutchan26-Dec-16 21:29
protectorRichard MacCutchan26-Dec-16 21:29 
AnswerRe: Multiple Inheritance question Pin
Vi228-Dec-16 18:35
memberVi228-Dec-16 18:35 
GeneralRe: Multiple Inheritance question Pin
samzcs28-Dec-16 18:40
membersamzcs28-Dec-16 18:40 
QuestionCalling a MFC dialog from win32 Pin
rdeekonda29-Jul-16 5:46
memberrdeekonda29-Jul-16 5:46 
AnswerRe: Calling a MFC dialog from win32 Pin
Afzaal Ahmad Zeeshan29-Jul-16 6:01
mveAfzaal Ahmad Zeeshan29-Jul-16 6:01 
GeneralRe: Calling a MFC dialog from win32 Pin
rdeekonda29-Jul-16 7:04
memberrdeekonda29-Jul-16 7:04 
AnswerRe: Calling a MFC dialog from win32 Pin
Richard MacCutchan29-Jul-16 6:46
protectorRichard MacCutchan29-Jul-16 6:46 
GeneralRe: Calling a MFC dialog from win32 Pin
rdeekonda29-Jul-16 7:08
memberrdeekonda29-Jul-16 7:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.