🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by gerry wiener Thu, 30 Mar 1989 16:44
constructor problem with g++1.34 on sun4-os4
#1815
Author: gerry wiener
Date: Thu, 30 Mar 1989 16:44
43 lines
927 bytes
I believe the following program should print

Initialize
Hello, world
Clean up

Instead it prints

Hello, world
Clean up

If the definition of y is placed inside main(), then the program prints

Initialize
Hello, world
Clean up

------------------------------------------------------------------------------
#include <stream.h>

class x
{
public:
  x();
  ~x();
};

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

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

x y;

main()
{
  cout << "Hello, world\n";
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads