|
by: Douglas Peterson |
last post by:
Take a look at this code, it looks funny as its written to be as short as
possible:
-- code --
struct Base
{
~Base() { *((char*)0) = 0; }
};
struct Derived : public Base
|
by: Timothy Madden |
last post by:
Hy
I have destructors that do some functional work in the program flow.
The problem is destructors should only be used for clean-up, because
exceptions might rise at any time, and destructors...
|
by: JAL |
last post by:
According to MSDN2, if a managed class throws an exception in the
constructor, the destructor will be called. If an exception is thrown in the
constructor the object never existed so how in the...
|
by: junw2000 |
last post by:
Hi,
Below is a simple code about exception.
#include <iostream>
using namespace std;
struct E {
const char* message;
E(const char* arg) : message(arg) { }
};
|
by: George2 |
last post by:
Hello everyone,
Suppose I have some objects created on local function stack (not on
heap). And I allocate and free all the related resources in the
constructor and destructor (e.g. memory and...
|
|
by: Vijay |
last post by:
Hi All,
I am not able to figure out what exactly happening in below code. what
is control flow. Can anyone clear my confusion?
Code:
class A
{
public:
A(){cout<<"In Constructor\n";}
|
by: amphetaman |
last post by:
If I derive my own Exception class from std::runtime_error, do I have
to write the destructor even if its body is empty?
#include <stdexcept>
class Exception : public std::runtime_error
{...
|
by: Peter Jansson |
last post by:
Dear newsgroup,
In the following code, it looks as though the exception thrown in the
constructor is not caught properly. I get this output:
---- standard output ----
Base() constructor....
|
by: john6630 |
last post by:
Coming from the .Net world, I am used to the try...catch...finally
approach to error handling. And PHP 5 now supports this approach. But
I am not clear what happens to unhandled errors/exceptioins?...
|
by: asm23 |
last post by:
Hi, everyone, I'm learning <<thinking c++>volume Two, and testing the
code below.
/////////////////////////////////////////////////////////////////////////////
//: C01:Wrapped.cpp
#include...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
|