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. General Programming
  3. Managed C++/CLI
  4. classes a few questions

classes a few questions

Scheduled Pinned Locked Moved Managed C++/CLI
data-structurestutorialquestion
3 Posts 2 Posters 0 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.
  • X Offline
    X Offline
    Xeef
    wrote on last edited by
    #1

    hi all if some one whit knowledege coud sacrify 2-3 minutes it woud save me a day time ;) a have a class X now i wana make a class Y wich woud derive all methodes, variables of X and has new ones i wana ensure in X that certain methode are implemented in Y wich arent in X but declared i wana overwrite methodes of X in Y how do i write functions for operators that this works : Myclass a=Myclass(); a++; a=a*a; ... .. i was try to use System::String inside a struct and was geting erros that i cant use a managed type in a struct blabla i have solved this by using a class instead but woud by nice to know if there is a way around similair problems seams to ocure if i try to use them as static i woud like to have a static array in my class whit a pointer to all instances of this class this is important else way i have trubel if some one coud give me a 10-20 line example it woud by great just code no need for description

    X C 2 Replies Last reply
    0
    • X Xeef

      hi all if some one whit knowledege coud sacrify 2-3 minutes it woud save me a day time ;) a have a class X now i wana make a class Y wich woud derive all methodes, variables of X and has new ones i wana ensure in X that certain methode are implemented in Y wich arent in X but declared i wana overwrite methodes of X in Y how do i write functions for operators that this works : Myclass a=Myclass(); a++; a=a*a; ... .. i was try to use System::String inside a struct and was geting erros that i cant use a managed type in a struct blabla i have solved this by using a class instead but woud by nice to know if there is a way around similair problems seams to ocure if i try to use them as static i woud like to have a static array in my class whit a pointer to all instances of this class this is important else way i have trubel if some one coud give me a 10-20 line example it woud by great just code no need for description

      X Offline
      X Offline
      Xeef
      wrote on last edited by
      #2

      working half way how can i get this out of class.h in to the class.cpp file : virtual int Show(void){return 1;}; virtual int Show(void)override{.... something like : virtual int Memory::Show(void)override{ wich isnt woking :((

      1 Reply Last reply
      0
      • X Xeef

        hi all if some one whit knowledege coud sacrify 2-3 minutes it woud save me a day time ;) a have a class X now i wana make a class Y wich woud derive all methodes, variables of X and has new ones i wana ensure in X that certain methode are implemented in Y wich arent in X but declared i wana overwrite methodes of X in Y how do i write functions for operators that this works : Myclass a=Myclass(); a++; a=a*a; ... .. i was try to use System::String inside a struct and was geting erros that i cant use a managed type in a struct blabla i have solved this by using a class instead but woud by nice to know if there is a way around similair problems seams to ocure if i try to use them as static i woud like to have a static array in my class whit a pointer to all instances of this class this is important else way i have trubel if some one coud give me a 10-20 line example it woud by great just code no need for description

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        You need to define operator* and operator+.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        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