473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Can I delete a static pointer?

Can I delete a static pointer?
Nov 30 '07 #1
2 7982

"dolphin" <jd*******@gmail.comwrote in message
news:b2**********************************@i12g2000 prf.googlegroups.com...
Can I delete a static pointer?
You can call delete on a static pointer and release the memory it points to
if it indeed points to memory that was allocated. If you are intending on
calling delete on a static pointer that is shared amongst multiple objects
I'd be careful...


Nov 30 '07 #2
On Nov 30, 7:44 am, dolphin <jdxyw2...@gmail.comwrote:
Can I delete a static pointer?
Yes...

Even if it's static, you need to manage the pointer - new/delete
operations!
Nov 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: A | last post by:
Hi, Consider this: char* ptr = "a string"; Is ptr a pointer to a dynamically created object for which i must use the delete operator to deallocate memory? I'm sure the "a string" part...
11
by: Jonan | last post by:
Hello, For several reasons I want to replace the built-in memory management with some custom built. The mem management itlsef is not subject to my question - it's ok to the point that I have...
10
by: n2xssvv g02gfr12930 | last post by:
In a job interview I was asked about the statement below: delete this; Naturally I was horrified, yet they claimed they had used it. Personally I'm pretty damn sure I could never justify this....
27
by: fermisoft | last post by:
I have a strange problem in my project. I have a class like this...... class CMsg { public: void *m_body; ~CMsg()
16
by: Martin Vorbrodt | last post by:
some butthole asked me an interview question: can you delete "this" pointer in a member function of a class, like this: class C { public: void foo() { delete this; } }; my answer was......
1
by: Gonçalo Rodrigues | last post by:
Hi all, I am a little confused about the delete operator, so I have a question. Suppose we have something like class Base { public: void* operator new(std::size_t size); void operator...
6
by: Ananas | last post by:
Hi, My native C++ function creates a dynamic array. I'm marshalling it to managed code and got to delete after. How to make it: c++ code: void CreateArrayInside( pTestStruct &TestStruct,...
6
by: mdinino | last post by:
Hi, I am new to C++, and I have a simple question but I can't seem to find a direct answer. If I use new to create something in the scope of a function and then I return the pointer that I...
12
by: subramanian100in | last post by:
Suppose class Base { public: virtual ~Test() { ... } // ... }; class Derived : public Base
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.