Click here to Skip to main content
15,917,177 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCan a locale be Removed from a basic_ostream Subsequent to basic_ostream.imbue(locale) Pin
BernardIE531717-Apr-24 1:48
BernardIE531717-Apr-24 1:48 
Greetings Kind Regards

Please consider the C++ code below. It is utilized it to generate a locale formatted number e.g. "1,234". However subsequent I wish again to generate a number but not so formatted e.g. "1234". So I inquire can an imbued locale be removed from an output stream so no such locale specific formatting occurs. Of course another stream which has not been so imbued can be utilized for this purpose but prefer not to do so as such seems a less elegant solution.

Thank You Kindly

basic_ostringstream<char> _ostream;
_ostream.imbue(locale("en-US"));
_ostream << 1234;

AnswerRe: Can a locale be Removed from a basic_ostream Subsequent to basic_ostream.imbue(locale) Pin
Mircea Neacsu17-Apr-24 2:03
Mircea Neacsu17-Apr-24 2:03 
GeneralRe: Can a locale be Removed from a basic_ostream Subsequent to basic_ostream.imbue(locale) Pin
BernardIE531717-Apr-24 11:55
BernardIE531717-Apr-24 11:55 
GeneralRe: Can a locale be Removed from a basic_ostream Subsequent to basic_ostream.imbue(locale) Pin
Mircea Neacsu17-Apr-24 12:14
Mircea Neacsu17-Apr-24 12:14 
Questionhow to add new class ? Pin
Salvatore Terress16-Apr-24 13:32
Salvatore Terress16-Apr-24 13:32 
AnswerRe: how to add new class ? Pin
Mircea Neacsu16-Apr-24 13:44
Mircea Neacsu16-Apr-24 13:44 
GeneralRe: how to add new class ? Pin
Salvatore Terress16-Apr-24 15:11
Salvatore Terress16-Apr-24 15:11 
GeneralRe: how to add new class ? Pin
Mircea Neacsu16-Apr-24 15:23
Mircea Neacsu16-Apr-24 15:23 
QuestionRe: how to add new class ? Pin
CPallini16-Apr-24 20:07
mveCPallini16-Apr-24 20:07 
AnswerRe: how to add new class ? Pin
Salvatore Terress17-Apr-24 2:34
Salvatore Terress17-Apr-24 2:34 
AnswerRe: how to add new class ? Pin
Richard MacCutchan16-Apr-24 23:59
mveRichard MacCutchan16-Apr-24 23:59 
AnswerRe: how to add new class ? Pin
BernardIE531717-Apr-24 1:57
BernardIE531717-Apr-24 1:57 
GeneralRe: how to add new class ? Pin
Salvatore Terress17-Apr-24 2:25
Salvatore Terress17-Apr-24 2:25 
GeneralRe: how to add new class ? Pin
BernardIE531717-Apr-24 9:21
BernardIE531717-Apr-24 9:21 
GeneralRe: how to add new class ? Pin
Salvatore Terress18-Apr-24 8:18
Salvatore Terress18-Apr-24 8:18 
Questionerasing makefile / make DEFINES ? Pin
Salvatore Terress15-Apr-24 13:05
Salvatore Terress15-Apr-24 13:05 
AnswerRe: erasing makefile / make DEFINES ? Pin
Salvatore Terress15-Apr-24 13:09
Salvatore Terress15-Apr-24 13:09 
Questionundefined reference - please help with linker issue Pin
Salvatore Terress11-Apr-24 8:37
Salvatore Terress11-Apr-24 8:37 
AnswerRe: undefined reference - please help with linker issue Pin
Richard Andrew x6411-Apr-24 9:25
professionalRichard Andrew x6411-Apr-24 9:25 
AnswerRe: undefined reference - please help with linker issue Pin
Richard MacCutchan11-Apr-24 21:01
mveRichard MacCutchan11-Apr-24 21:01 
QuestionBreak in a for loop Pin
Calin Negru11-Apr-24 1:19
Calin Negru11-Apr-24 1:19 
AnswerRe: Break in a for loop Pin
Mircea Neacsu11-Apr-24 1:28
Mircea Neacsu11-Apr-24 1:28 
AnswerRe: Break in a for loop Pin
Maximilien11-Apr-24 2:43
Maximilien11-Apr-24 2:43 
GeneralRe: Break in a for loop Pin
Calin Negru11-Apr-24 3:08
Calin Negru11-Apr-24 3:08 
GeneralRe: Break in a for loop Pin
CPallini11-Apr-24 4:17
mveCPallini11-Apr-24 4:17 

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.