   Help with something.
  Hi, i''ve been programming in C++ for a while now and i''ve used things like int and char to define a variable, but i''m not sure what all thesed definers mean, this is how i understand them so far... int is and integer and represents whole numbers or characters, float is using decimal points, char represents characters, this is my understanding anyway, please correct me on those if i''m wrong. anyway, here is my question, i have been reading books on c++, and they use different definers,  such as void, word, dword, byte, also i''ve seen unsigned in front of definers like unsigned int, what does this mean?   any help with any of these is appreciated, i just want to understand what these things do.  
  Dang, you are truly starting from scratch here.  Let''s see if I can''t give you a quick tutorial on this.As you should probably know by now, all the information in a computer is stored in binary.  What this means is that all the information is stored in numbers using base 2, (in other words 0''s and 1''s.)  If you don''t know what a nunber base is I will explain it, otherwise skip to the next paragraph.  A number base tells you how many numbers there are before you move to the next significant bit.  In everyday life we use base 10, which means that we have the nunbers 0-9 before we have to add another column of numbers.  Well in binary you have a base two or 0-1.  So the number 5 say would be 101.  Another way to look at it is that each column represents an exponent of two so to convert 101 to decimal (base 10) we would multiply each place by it''s position in the number-1, ex( 101 = 1*2^2+0*2^1+1*2^0 = 4 + 0 + 1 = 5)  So anything you define in c or c++ is actually a number or a list of numbers.So each variable is a number.  We can then define these numbers to mean different things.  An integer for example we define to be an integer, like in my example above.  On most modern computers and compilers and integer is 32 bits long, which means that it consists of 32 1''s and 0''s.  So if look at the method of converting I showed you above you can see that an integer can store a value between 0 and about 4 billion.  However we also want to be able to store negative values, so what happens is the computer defines all the numbers with a 1 in the far left position as being negative, so instead of having numbers between 0 and 4 billion, we now have numbers between -2 billion and 2 billion.So what the unsigned does is it lets us decide if we what to use numbers from 0 to 4 billion, or numbers from -2 billion to 2 billion.Now on to chars.  Yes chars are used to represent characters, however you have to understand that in reality they are no different from ints, only smaller.  A char is ussually 8 bits, or 8 1''s and 0''s.  This means that a char can represent numbers between 0 and 255, or 256 total numbers.  Using this we can then encode a character for each number.  This is called the ascii table.  An example would be the letter ''a'' is number 97, the character ''6'' is number 54.  The comiler takes care of these conversions for you so anytime you put in ''a'' the compiler substitutes in 97, and anytime you try to print to the screen the compiler or the OS sees 97 and makes an ''a'' character.floats are a bit more complex but the same idea sort of holds true, they actually use exponents and multiplication to store the value.Now for the definers.  Let''s start with void.  Ussually you will see void as a return type for a function or method.  This just means that it returns nothing.  The word void in english means emptiness, so this is fitting.  You will also see void used to define pointers such as void* temp;  All this means is that the pointer temp doesn''t point to a particular type of variable or object.  A word is a term for a set of bytes, usually four, dword is a double work, or 2 words, which means usually eight bytes.  As for a bytes, a byte is 8 bits, the same size as a char.  Which means a word is the same size as an int.  Anytime someone uses a byte in a c or c++ programming they are probably just redefining a char and not using it as a character but instead as a small integer.I hope this all helps.Dustin  ;  Thanks alot! That helped a lot, i''ve used all of these before but never really understood what they did and meant, now i do, thanks alot.  ;  Excellent explanation! I just have one tiny, niggling correction/alteration:quote:Original post by Dustop1   A number base tells you how many numbers there are before you move to the next significant bit.   That should read "a number base tells you how many numbers there are before you move to the next significant digit    ", since a bitis just a b  inary digit    . A bit can only hold one of two values (being binary), so it can't represent a decimal digit, for example. Semantics, I know, but I think it's important. **Edit: Stranded "b" in binary.Edited by - Oluseyi on July 6, 2001 3:28:58 AM  