Click here to Skip to main content
15,910,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Ok new Interger query! Pin
ThatsAlok3-Oct-07 19:06
ThatsAlok3-Oct-07 19:06 
AnswerRe: Ok new Interger query! Pin
David Crow4-Oct-07 3:45
David Crow4-Oct-07 3:45 
AnswerRe: Ok new Interger query! Pin
DQNOK4-Oct-07 4:17
professionalDQNOK4-Oct-07 4:17 
QuestionIntegers and Char Arrays! Pin
Michael1013-Oct-07 15:47
Michael1013-Oct-07 15:47 
AnswerRe: Integers and Char Arrays! Pin
Naveen3-Oct-07 16:22
Naveen3-Oct-07 16:22 
GeneralRe: Integers and Char Arrays! Pin
Michael1013-Oct-07 17:15
Michael1013-Oct-07 17:15 
AnswerRe: Integers and Char Arrays! Pin
ThatsAlok3-Oct-07 19:01
ThatsAlok3-Oct-07 19:01 
AnswerRe: Integers and Char Arrays! Pin
jhwurmbach3-Oct-07 22:35
jhwurmbach3-Oct-07 22:35 
You can use
#include <strstream>

const int number = 47;

std::stringstream stream;
stream << number;

std::string numberAsString = stream.str();
This way, you are using the power of the STL for you, and are avoiding literally thousands of error possibilities when fiddeling around with char-pointers and string lenghts.

The std::string would fit in nicely with the std::vector (or any oher standard container), and as a plus you can get the content as a plain old C-String by calling its c_str()-member.

Just to bring regular C++ to the mind, instead of this ugly 30+years old C code floating around here.




Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
George Orwell, "Keep the Aspidistra Flying", Opening words

QuestionDoubles change behavior in CreateThread process, why? Pin
TragicComic3-Oct-07 15:13
TragicComic3-Oct-07 15:13 
AnswerRe: Doubles change behavior in CreateThread process, why? Pin
TragicComic3-Oct-07 15:32
TragicComic3-Oct-07 15:32 
GeneralRe: Doubles change behavior in CreateThread process, why? Pin
DQNOK4-Oct-07 4:26
professionalDQNOK4-Oct-07 4:26 
Questionretrieve email password on local host? Pin
Gofur Halmurat3-Oct-07 12:36
Gofur Halmurat3-Oct-07 12:36 
AnswerRe: retrieve email password on local host? Pin
Mark Salsbery3-Oct-07 13:03
Mark Salsbery3-Oct-07 13:03 
AnswerRe: retrieve email password on local host? Pin
Stephen Hewitt3-Oct-07 14:44
Stephen Hewitt3-Oct-07 14:44 
AnswerRe: retrieve email password on local host? Pin
Maximilien3-Oct-07 15:37
Maximilien3-Oct-07 15:37 
QuestionLinking to MFC in a non-MFC dll [modified] Pin
Leslie Sanford3-Oct-07 9:45
Leslie Sanford3-Oct-07 9:45 
AnswerRe: Linking to MFC in a non-MFC dll Pin
Nathan Holt at EMOM3-Oct-07 10:49
Nathan Holt at EMOM3-Oct-07 10:49 
AnswerRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery3-Oct-07 11:31
Mark Salsbery3-Oct-07 11:31 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford3-Oct-07 13:59
Leslie Sanford3-Oct-07 13:59 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 5:40
Mark Salsbery4-Oct-07 5:40 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 6:25
Leslie Sanford4-Oct-07 6:25 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 6:43
Mark Salsbery4-Oct-07 6:43 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 6:56
Leslie Sanford4-Oct-07 6:56 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 7:11
Mark Salsbery4-Oct-07 7:11 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 7:48
Leslie Sanford4-Oct-07 7:48 

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.