| |

VerySource

 Forgot password?
 Register
Search
View: 972|Reply: 6

How to watch the global destructor? For teaching purposes only

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-30 12:00:01
| Show all posts |Read mode
Compiler: dev--c ++
A class object is defined globally.

I used to return 0 in the main function; I added cin before the statement, but the global object is destructed after main is executed. What should I do?

Do you want to use tubor c
Reply

Use magic Report

0

Threads

55

Posts

44.00

Credits

Newbie

Rank: 1

Credits
44.00

 Invalid IP Address

Post time: 2020-3-6 17:45:01
| Show all posts
Execute the program in the command line window, do not execute in the integrated compilation environment.
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-10 18:00:02
| Show all posts
superandy
 
 
   Execute the program in the command line window, do not execute in the integrated compilation environment.
  -------------------------------------------------- -----------
How do I execute a program in a command window?
Reply

Use magic Report

0

Threads

19

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-3-11 12:15:01
| Show all posts
Start-run-cmd, go to the program directory and execute the exe program
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-13 23:15:01
| Show all posts
Add a breakpoint to the destructor
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-3-15 06:45:01
| Show all posts
Does cout work in class destructors?
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-16 15:00:01
| Show all posts
Thank you all!

The endpoint hasn't been tried yet, the command line is great!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list