Click here to Skip to main content
15,916,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProcess Infomation Pin
8-Mar-01 20:13
suss8-Mar-01 20:13 
GeneralRe: Process Infomation Pin
l a u r e n8-Mar-01 21:06
l a u r e n8-Mar-01 21:06 
GeneralRe: Process Infomation Pin
Tim Deveaux10-Mar-01 13:07
Tim Deveaux10-Mar-01 13:07 
GeneralButton Coordinates in ClientRect Pin
8-Mar-01 17:46
suss8-Mar-01 17:46 
GeneralRe: Button Coordinates in ClientRect Pin
Christian Graus8-Mar-01 18:05
protectorChristian Graus8-Mar-01 18:05 
QuestionOverriding function main()? Pin
Jason Gerard8-Mar-01 14:47
Jason Gerard8-Mar-01 14:47 
AnswerRe: Overriding function main()? Pin
Michael Dunn8-Mar-01 15:58
sitebuilderMichael Dunn8-Mar-01 15:58 
GeneralRe: Overriding function main()? Pin
Jason Gerard8-Mar-01 16:59
Jason Gerard8-Mar-01 16:59 
I meant overload, I'm always interchanging them by accident. Anyway, my teacher's English is not very good and I posted this during class. I talked with him and a few students and we all misunderstood him. Apparently, he wants us to somehow derive from ostream or streambuf and overload operator<< for cout. Not quite sure how but that is what he said. Thanks for the help.

However, I tried your approach but the destructor is never called.

Here is the output:

Initialize
Hello, World
Press any key to continue


Here are some code snippets:

//MyClass.h

class MyClass
{
public:
MyClass();
~MyClass();

};

//MyClass.cpp

MyClass::MyClass()
{cout << "Initialize\n";}

MyClass::~MyClass()
{cout << "Clean up\n";}

// test.cpp

#include <iostream>
#include "MyClass.h"
using namespace std;
MyClass myClass = MyClass();
int main()
{
cout << "Hello, World\n";
return 0;
}

MCSD, MCSE
GeneralRe: Overriding function main()? Pin
Christian Graus8-Mar-01 17:16
protectorChristian Graus8-Mar-01 17:16 
GeneralRe: Overriding function main()? Pin
Christian Graus8-Mar-01 17:16
protectorChristian Graus8-Mar-01 17:16 
GeneralRe: Overriding function main()? Pin
Jason Gerard9-Mar-01 13:44
Jason Gerard9-Mar-01 13:44 
GeneralRe: Overriding function main()? Pin
Christian Graus9-Mar-01 22:35
protectorChristian Graus9-Mar-01 22:35 
GeneralRe: Overriding function main()? Pin
l a u r e n10-Mar-01 2:49
l a u r e n10-Mar-01 2:49 
GeneralRe: Overriding function main()? Pin
Christian Graus10-Mar-01 12:33
protectorChristian Graus10-Mar-01 12:33 
GeneralRe: Overriding function main()? Pin
Jason Gerard10-Mar-01 5:21
Jason Gerard10-Mar-01 5:21 
GeneralRe: Overriding function main()? Pin
Christian Graus10-Mar-01 12:37
protectorChristian Graus10-Mar-01 12:37 
GeneralSomebody here must know this one...win32 question Pin
Josh Knox8-Mar-01 13:43
Josh Knox8-Mar-01 13:43 
GeneralFindFirstFile and UNC paths Pin
Rhoam8-Mar-01 13:01
Rhoam8-Mar-01 13:01 
GeneralRe: FindFirstFile and UNC paths Pin
Michael Dunn8-Mar-01 13:26
sitebuilderMichael Dunn8-Mar-01 13:26 
GeneralRe: FindFirstFile and UNC paths Pin
Rhoam8-Mar-01 14:05
Rhoam8-Mar-01 14:05 
GeneralRe: FindFirstFile and UNC paths Pin
Michael Dunn8-Mar-01 16:02
sitebuilderMichael Dunn8-Mar-01 16:02 
GeneralI'm not getting an OnChar() Event... Pin
Chris Simeone8-Mar-01 8:08
Chris Simeone8-Mar-01 8:08 
GeneralRe: I'm not getting an OnChar() Event... Pin
Chris Losinger8-Mar-01 8:19
professionalChris Losinger8-Mar-01 8:19 
GeneralRe: I'm not getting an OnChar() Event... Pin
Erik Funkenbusch8-Mar-01 11:18
Erik Funkenbusch8-Mar-01 11:18 
General:eek: Preview Printing Pin
BERTHOMIER Eric8-Mar-01 7:14
BERTHOMIER Eric8-Mar-01 7:14 

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.