Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhelp with implementation of strspn( ) Pin
kaku_lala1-May-09 15:44
kaku_lala1-May-09 15:44 
QuestionRe: help with implementation of strspn( ) Pin
David Crow1-May-09 16:11
David Crow1-May-09 16:11 
AnswerRe: help with implementation of strspn( ) Pin
Stuart Dootson1-May-09 16:15
professionalStuart Dootson1-May-09 16:15 
Questionwhat is wrong with this code snippet - memset() implementation Pin
kaku_lala1-May-09 15:42
kaku_lala1-May-09 15:42 
AnswerRe: what is wrong with this code snippet - memset() implementation Pin
Stuart Dootson1-May-09 16:11
professionalStuart Dootson1-May-09 16:11 
AnswerRe: what is wrong with this code snippet - memset() implementation Pin
David Crow1-May-09 16:15
David Crow1-May-09 16:15 
AnswerRe: what is wrong with this code snippet - memset() implementation Pin
Joe Woodbury1-May-09 19:32
professionalJoe Woodbury1-May-09 19:32 
QuestionOperator overloading and chaning streaming operators Pin
squall231-May-09 14:04
squall231-May-09 14:04 
I am currently writing at some kind of logging class and want to improve the usability by overloading the streaming operator. The idea is that i can use the class LogClass in the following two ways:

LogClass test;
std::string blub("blub");

// 1. option: streaming into the log object
test  << "bla " << blub;

// 2. option: streaming through the log object
std::cout << test << "bla " << blub;


In both cases the content of the objects which are located on right should be logged inside the test object. In the second case the content should also be forwarded to cout.

I was already able to handle some simple cases like the following:
LogClass test;
std::string blub("blub");

// 1. option: streaming into the log object
test  << "bla ";

// 2. option: streaming through the log object
std::cout << test << blub;


Therefore i overloaded the operator twice like this:
friend std::ostream& operator<<(std::ostream &os, const LogClass &logClass);
void operator<<(const std::string &os);


But this isn't working for more complex scenarios.

I would be really grateful when anyone could give me a hint how this is done probably.

Regards squall23
AnswerRe: Operator overloading and chaning streaming operators Pin
Stuart Dootson1-May-09 16:06
professionalStuart Dootson1-May-09 16:06 
GeneralRe: Operator overloading and chaning streaming operators Pin
squall232-May-09 1:41
squall232-May-09 1:41 
QuestionHow do I debug a release build? Pin
bulg1-May-09 10:42
bulg1-May-09 10:42 
AnswerRe: How do I debug a release build? Pin
Rolf Kristensen1-May-09 11:31
Rolf Kristensen1-May-09 11:31 
GeneralRe: How do I debug a release build? Pin
bulg1-May-09 13:51
bulg1-May-09 13:51 
GeneralRe: How do I debug a release build? Pin
Stuart Dootson1-May-09 15:22
professionalStuart Dootson1-May-09 15:22 
QuestionPutting out plain text Pin
BobInNJ1-May-09 8:09
BobInNJ1-May-09 8:09 
QuestionRe: Putting out plain text Pin
David Crow1-May-09 8:19
David Crow1-May-09 8:19 
AnswerRe: Putting out plain text Pin
BobInNJ1-May-09 10:00
BobInNJ1-May-09 10:00 
GeneralRe: Putting out plain text Pin
David Crow1-May-09 10:03
David Crow1-May-09 10:03 
QuestionRe: Putting out plain text Pin
Maximilien1-May-09 8:24
Maximilien1-May-09 8:24 
AnswerRe: Putting out plain text Pin
Chris Losinger1-May-09 9:07
professionalChris Losinger1-May-09 9:07 
GeneralRe: Putting out plain text Pin
BobInNJ2-May-09 4:41
BobInNJ2-May-09 4:41 
Questionshow the picture in the same window of MFC insted of showing in new window Pin
trinhminhson1-May-09 8:00
trinhminhson1-May-09 8:00 
Questionurgent please help basic c Pin
biggiant220001-May-09 6:09
biggiant220001-May-09 6:09 
AnswerRe: urgent please help basic c Pin
biggiant220001-May-09 6:19
biggiant220001-May-09 6:19 
AnswerRe: urgent please help basic c Pin
Chris Losinger1-May-09 6:32
professionalChris Losinger1-May-09 6:32 

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.