Quote (RecenT @ Apr 9 2014 01:41pm)
mmm.. I'm trying to learn how you guys are doing it. I haven't learned some of these stuff.
I use using namespace std;, but I can see that you can use std:: instead.
I understand the setters/getters and had it set up like that.
But I don't understand why you use "int main(int argc, const char * argc). In fact, I'm not sure what that does for main and how that would be called.
Not really understanding the typedef short Ushort and typedef const Ushort cUshort.
:////////////
-When you include parts of the standard library, all the functions, constants, etc. are placed into a scope of names called a namespace. In the case of the standard library, the namespace is called "std". When you type "using namespace std;", that tells the compiler that the code you are going to write following it can directly "see" all those functions, constants, etc. that you included from the standard libraries. On the other hand, if you don't do "using namespace std;", you can still refer to the "std" namespace by prefixing your functions, constants, etc with "std::".
-"int main(int argc, const char* argv[])" is the standard function prototype for main. You can, however, omit argc and argv (as long as you don't use them) and nothing will happen. The purpose of those two variables is to receive the command line arguments for when you execute your program. "argc" stands for "argument count", while "argv" stands for "argument vector". For example, suppose you have a program named "foobar.out", and you run it like "./foobar.out". You had one command line argument, "./foobar.out", so "argc" will be 1 (argc==1), and "argv" will be an array containing one string (strcmp(argv[0], "./foobar.out")==0).
-typedef is just a way to abbreviate type names or rename them to whatever you want. If you really wanted to, for example, you could do "typedef int number;" and declare all of your integers as "number myInteger;", which would be equivalent to declaring them as "int myInteger;".