Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. _GC pointers [modified]

_GC pointers [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
questionc++tutorial
2 Posts 2 Posters 13 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    syedhasan
    wrote on last edited by
    #1

    I am unable to understand the gc concept of the mc++, as per the example for managed pointers in mc++ using gc there is no any proper explanation, i am putting the code, if someone is able to explain it, i will be thankful to you. __gc struct G { int i; }; __value struct V { int i; }; int main() { // defaults to V __gc * __nogc * ppV; V ** ppV; // defaults to V __gc * __nogc * __nogc * pppV; V *** pppV; // defaults to G __gc * __gc * ppG; G ** ppG; // defaults to G __gc * __gc * __nogc * pppG; G *** pppG; // defaults to G __gc * __gc * __nogc * __nogc * ppppG; G **** ppppG; } my question is : why there are only two _gc's for the garbage collected why not all are garbage collected, or what is the advantage of _gc pointer coming for one time and coming for two times, can anyone explain me? -- modified at 5:15 Tuesday 15th May, 2007

    Thanks, Syed

    M 1 Reply Last reply
    0
    • S syedhasan

      I am unable to understand the gc concept of the mc++, as per the example for managed pointers in mc++ using gc there is no any proper explanation, i am putting the code, if someone is able to explain it, i will be thankful to you. __gc struct G { int i; }; __value struct V { int i; }; int main() { // defaults to V __gc * __nogc * ppV; V ** ppV; // defaults to V __gc * __nogc * __nogc * pppV; V *** pppV; // defaults to G __gc * __gc * ppG; G ** ppG; // defaults to G __gc * __gc * __nogc * pppG; G *** pppG; // defaults to G __gc * __gc * __nogc * __nogc * ppppG; G **** ppppG; } my question is : why there are only two _gc's for the garbage collected why not all are garbage collected, or what is the advantage of _gc pointer coming for one time and coming for two times, can anyone explain me? -- modified at 5:15 Tuesday 15th May, 2007

      Thanks, Syed

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      I don't have an answer for you, but to keep it on-topic, this confusing overloading of the meaning of * was a major flaw in MC++, and it's been fixed in C++/CLI by denoting GC handles with ^ instead.

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups