@ben77 - If you want to follow OOP style then try to use properties in passing data between forms/classes.
@ben77 - If you want to follow OOP style then try to use properties in passing data between forms/classes.
all are in OOP style![]()
@eax, allow me to share about this, just correct me if I made something wrong in your point of view, considering I'm still new in C# and still still still recovering where I was lost.... C# is not forgiving this time.
C++ enums are not type-safe while C# strongly are...okay, MS won on this.... hurray....!!!
but unfortunately, C# enum cannot be implicity assign to another enum even though members are they same! ohhhhh... and I almost slam my keyboard figuring it out what the heck went wrong, and thus, this is one of the pitfalls that anyone who was working C++ before and try to study C#. how sad....C++ enums is more manageable I guess...
We once had problem before importing native C++ enums in .NET project under C#. luckily, geeks out there already shared and discuss, most of the victims were came from C++ project doing C# ...but if you try to view on the next release of c++ C++0x - Wikipedia, the free encyclopedia they abit changed for good.
another thing is C/C++ enums "scope", where in the first place they don't have "class scope" concept. well, alot of things to discuss about enums though, like casting your enums while in C# you don't have to... but so far, the underlying "System.Enum" in .NET class library is the base class of enum types and it already contains methods that allow you to work in various ways (I hope so, this was based from ben's post) hope to learn more someday....
@MarkCuering
notice on the "cast" on his "OBJECT" approached, its no longer required, or let say its an illegal in C++ point of view... in C# it runs but technically it is wrong. and try not to use "Properties Approached" its not safe...
fully noted...
thanks again bro....
@ta3
thanks for the tip... i appreciate the help bro...
salamat sa tanan
Last edited by eax; 11-15-2008 at 06:04 PM.
yup....that's why its not the same...they way you manipulate and in compilers point of view...
bro paki rephrase hehehe, what makes you think that C++ Boolean is considered as Integer?
BOOL only uses 1 bit of memory
INTEGER is 16 bits of memory in 16bit architecture and on its compiler, and at present
INTEGER is 32 bits like native x86 processors in LINUX or WINDOWS, same as it would be in 64bit processor unless you will override it with some compiler settings.
or what you mean to say is BOOLEAN statement? that in C# you have to explicitly compare? not like C++ where you can use if(x).
OT :
in c++ you can compre bool as integer like char. For sample code :
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
bool is_integer = false;
if (is_integer == 0) {
cout << "false" << endl;
}
cout << is_integer << endl;
}
I think bit, char, byte, short are also classified as integers they only differ in sizes.
I see...although we normally can make it as if(x) where x is TRUE or FALSE... or Bit 1 or Bit 0 (internally)
Similar Threads |
|