473,395 Members | 1,624 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,395 software developers and data experts.

How to delete multidimesional array in Visual C++ .Net 2008?

Hello,

I have Class name as MyClass and created multidimesional array of object.
Example is given below.

// clr_array.cpp
// compile with: /clr
ref class MyClass {};
int main() {
array<MyClass ^> ^ MyArray = gcnew array<MyClass ^>(100);
}


I have problem, how to delete this array of objects.?
Dec 16 '08 #1
4 2630
JosAH
11,448 Expert 8TB
Is this C++ or some MS-ism?

kind regards,

Jos
Dec 16 '08 #2
oler1s
671 Expert 512MB
It's C++/CLI, the modified version of C++ for the .NET platform. Good luck getting good help for it.

Do you need to delete the array of objects? I imagine they get garbage collected.
Dec 16 '08 #3
vmpstr
63
This is MS-ism. Apparently, ^ is to signify a handle, which acts basically like a pointer, but is garbage collected (hence gcnew instead of new: gc stands for garbage collected).

Given that it is garbage collected, it will be deleted for you once there are no more preferences to that address... hopefully.
Dec 16 '08 #4
Banfa
9,065 Expert Mod 8TB
If you really feel the need to you can use delete to delete objects allocated with gcnew. However as has already been pointed out gcnew returns a handle that the garbage collect monitors and when there are not more references to that handle the data is automatically deleted (garbage collected).
Dec 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Eric A. Johnson | last post by:
Hi, I am working on a way to create a "window" within a dos console. I'm using Microsoft Visual C++. My main problem is that I am using new to create a new CHAR_INFO array within the...
6
by: valerij | last post by:
Please help. I have been on this problem for a week now. I am using Windows 98SE, Microsoft Visual C++ 6.0 The following program only works when the function is not called, BUT the function does...
29
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I remembered delete is implemented through operator overloading, but I am not quite clear. Could anyone recommend some links about how delete is implemented so that I can...
3
by: =?Utf-8?B?SXpvcmljaA==?= | last post by:
I observed that WCF client running inside Full Trust mode XBAP application can't read byte array over 16384. If return result is bigger than that size, then client simply get null or Nothing in VB...
6
by: nembo kid | last post by:
I have these classes: Boss, CommissionWorker, PieceWorker, HourlyWorker all directly derived from Employeer. I create a dynamic object (on heap) for each class:
8
by: Michel Esber | last post by:
Hello, Env: DB2 V8 LUW FP16 running Linux create Table X (machine_id varchar(24) not null, ctime timestamp not null); create index iFoo on X (MACHINE_ID, CTIME) allow reverse scans; alter...
9
by: =?Utf-8?B?R2Vla0JveQ==?= | last post by:
I did not see another group for this so I presume this is the correct one to ask such a question. Anyway, I need to get data entered into a textbox and put it all into an array. I have looked...
2
by: TamaThps | last post by:
I have to write a program that takes the lines of code from a .cpp as a string into an array. Then I need to compute the ratio of total lines of code to the number of comment lines, and ratio of...
0
by: Abhijitit | last post by:
Hello, I have Class name as MyClass and created multidimesional array of object. Example is given below. // clr_array.cpp // compile with: /clr ref class MyClass {}; int main() {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.