Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 1st, 2006, 8:30 AM   #1
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
__gc class

if i create a managed C++ class :
__gc class MyClass
And say one of its members is a pointer to a string
string * MyString
Does MyString have to be declared a __gc string pointer or i need not do that as the class is managed and members dont have to be.
One more thing on managed c++. Garbage collection happens when a pointer or referenced object "falls out of scope" exactly what does that mean in terms of memory management and when does it occur in a program.
thanks ..
hbe02 is offline   Reply With Quote
Old Aug 1st, 2006, 8:50 AM   #2
JimmyJim
Programmer
 
JimmyJim's Avatar
 
Join Date: Jul 2006
Location: England
Posts: 43
Rep Power: 0 JimmyJim is on a distinguished road
Garbage Collection is where when a object on the heap that no longer has any references to it remaining it is deleted automatically. This avoids the need to manually delete in your code.

There are some verious ways this can be achieved. The most common is where the heap is copied to a new heap and any objects on the heap that have no references remaining will be left behind and so will be removed. There are machanisms to figure out if there is circular references and remove objects that refer to other objects on the heap with no references in the scope of your program.

Managed C++ is a dire language and i would keep well away. MS have replaced it with C++/CLI which comes with .net 2.0. Its much improved though i still dont really see the use of it. If you are a C++ developer converting to .net its probably a better idea to go with C# as its the number one language on .net.

I have not looked at managed C++ in quite a while so i cant remember the syntax so i will avoid spreading rubbish. If you need C++ for .net use C++/CLI its 10 times better, or use C# which is far far more straight forward.
JimmyJim is offline   Reply With Quote
Old Aug 1st, 2006, 4:36 PM   #3
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
hey thanks for the helpfull feedback on garbage collection JimmyJim ..
I am currently learning c++.net to get into GUI's and connecting to & operating on SQL databses.. But will convert to C#.net next spring..
hbe02 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URL class Eric the Red Java 5 Jun 24th, 2006 10:01 PM
using classes in another class ling_wong C++ 6 Jan 23rd, 2006 10:55 PM
What is: "Oriented programming (OO)?" BrinyCode C++ 12 Nov 22nd, 2005 8:40 AM
User Input for Number Format ericelysia1 Java 0 Jul 21st, 2005 4:41 PM
MFC/OpenGL: problem with 'Document' class brenda C++ 11 May 23rd, 2005 9:10 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC