Click here to Skip to main content
15,923,197 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: looking for project to help with Pin
toxcct2-Nov-04 4:11
toxcct2-Nov-04 4:11 
GeneralRe: looking for project to help with Pin
toxcct22-Aug-05 4:52
toxcct22-Aug-05 4:52 
GeneralRe: looking for project to help with Pin
BlackDice22-Aug-05 5:34
BlackDice22-Aug-05 5:34 
GeneralRe: looking for project to help with Pin
toxcct22-Aug-05 5:54
toxcct22-Aug-05 5:54 
GeneralTile Windows Horizontally and Tile Windows Vertically Pin
Ali Niaz14-Oct-04 5:54
Ali Niaz14-Oct-04 5:54 
GeneralRe: Tile Windows Horizontally and Tile Windows Vertically Pin
BlackDice14-Oct-04 6:35
BlackDice14-Oct-04 6:35 
GeneralRe: Tile Windows Horizontally and Tile Windows Vertically Pin
David Crow14-Oct-04 6:45
David Crow14-Oct-04 6:45 
QuestionException object destroyed 3 times? Pin
Bob Stanneveld14-Oct-04 5:36
Bob Stanneveld14-Oct-04 5:36 
Hello,

Consider the following code:
<br />
class A<br />
{<br />
public:<br />
  A() {}<br />
  ~A() <br />
  { <br />
    static int i = 0;<br />
    std::cout << "Destructor called " << ++i << " time(s)" <br />
              << std::endl;<br />
  }<br />
};<br />
<br />
void main()<br />
{<br />
    try<br />
    {<br />
       throw A;<br />
    }<br />
    catch(A ex)<br />
    {<br />
    } <br />
}<br />

When I run the code, the output is the following:
Destructor called 1 time(s)
Destructor called 2 time(s)
Destructor called 3 time(s)
Press any key to continue


I can figure why the destructor is called 2 times, but why is it called the 3d time??? Confused | :confused: Confused | :confused:


Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.

AnswerRe: Exception object destroyed 3 times? Pin
John M. Drescher14-Oct-04 6:25
John M. Drescher14-Oct-04 6:25 
GeneralRe: Exception object destroyed 3 times? Pin
Bob Stanneveld14-Oct-04 6:31
Bob Stanneveld14-Oct-04 6:31 
GeneralErrors C2371 and C2512. Pin
Cleber Marinho14-Oct-04 4:49
sussCleber Marinho14-Oct-04 4:49 
QuestionCleanup of exception objects? Pin
Bob Stanneveld14-Oct-04 3:44
Bob Stanneveld14-Oct-04 3:44 
AnswerRe: Cleanup of exception objects? Pin
Nathan Holt at EMOM14-Oct-04 5:06
Nathan Holt at EMOM14-Oct-04 5:06 
GeneralRe: Cleanup of exception objects? Pin
Bob Stanneveld14-Oct-04 5:16
Bob Stanneveld14-Oct-04 5:16 
AnswerRe: Cleanup of exception objects? Pin
Cleber Marinho14-Oct-04 5:11
sussCleber Marinho14-Oct-04 5:11 
GeneralRe: Cleanup of exception objects? Pin
Bob Stanneveld14-Oct-04 5:21
Bob Stanneveld14-Oct-04 5:21 
Generalchar array -&gt; system::string Pin
Darcy P14-Oct-04 2:57
Darcy P14-Oct-04 2:57 
GeneralCString problem Pin
Anonymous14-Oct-04 2:33
Anonymous14-Oct-04 2:33 
GeneralRe: CString problem Pin
David Crow14-Oct-04 2:42
David Crow14-Oct-04 2:42 
GeneralRe: CString problem Pin
BlackDice14-Oct-04 3:01
BlackDice14-Oct-04 3:01 
GeneralRe: CString problem Pin
Bob Stanneveld14-Oct-04 3:33
Bob Stanneveld14-Oct-04 3:33 
GeneralRe: CString problem Pin
hyling14-Oct-04 4:17
hyling14-Oct-04 4:17 
GeneralLinking a C# dll into C++ Pin
Member 131514814-Oct-04 2:21
Member 131514814-Oct-04 2:21 
GeneralDirectX CreateSurface question Pin
Cedric Moonen14-Oct-04 2:03
Cedric Moonen14-Oct-04 2:03 
GeneralRe: DirectX CreateSurface question Pin
BlackDice14-Oct-04 3:03
BlackDice14-Oct-04 3:03 

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.