Basic help guys
-
First of all, I'm really sorry for my english, hope youll understand what I'm asking for... :-) I need to define a class contains fields as strings and integers, a constructor, properties and Set/Get function. In main(), I need to creat an object of this class and access it's info. I need to create a sub-class (I think it's called this way... which goes by "class x:y" syntex...), to add fields in it, Set/Get function, properties, and define an object in main(). I know it sounds lots of work, but actually it's nothing for you guys. I'm not asking you to write one especially for me, but if you have an example code - i'll be gratefull!!! Thank you in advance!
-
First of all, I'm really sorry for my english, hope youll understand what I'm asking for... :-) I need to define a class contains fields as strings and integers, a constructor, properties and Set/Get function. In main(), I need to creat an object of this class and access it's info. I need to create a sub-class (I think it's called this way... which goes by "class x:y" syntex...), to add fields in it, Set/Get function, properties, and define an object in main(). I know it sounds lots of work, but actually it's nothing for you guys. I'm not asking you to write one especially for me, but if you have an example code - i'll be gratefull!!! Thank you in advance!
This is really basic stuff, have you thought about buying a book ? public class A { public class B { private int _i; public int I { get { return _i; } set { _i = value; } } public B() { _i = 42; } } }
Christian Graus - Microsoft MVP - C++ "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 )
-
First of all, I'm really sorry for my english, hope youll understand what I'm asking for... :-) I need to define a class contains fields as strings and integers, a constructor, properties and Set/Get function. In main(), I need to creat an object of this class and access it's info. I need to create a sub-class (I think it's called this way... which goes by "class x:y" syntex...), to add fields in it, Set/Get function, properties, and define an object in main(). I know it sounds lots of work, but actually it's nothing for you guys. I'm not asking you to write one especially for me, but if you have an example code - i'll be gratefull!!! Thank you in advance!
I suggest you buy a book on C# and study it. You will learn nothing from our answers. This looks a lot like home work. You will get stuck again in the next excercise and then maybe nobody here will be nice to you. Being a programmer is a great job but it takes a lot of pain to learn.
Rudolf Heijink