classes a few questions
-
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
-
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
-
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
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 )