what is the deal with the unsigned data type, e.g.
unsigned int ...etc
what is the unsigned data type & what is it used for?
& also what are the #ifdef & ifndef compiler directives used for??
(i am a beginner)
any help will be appreciated...
what is the deal with the unsigned data type, e.g.
unsigned int ...etc
what is the unsigned data type & what is it used for?
& also what are the #ifdef & ifndef compiler directives used for??
(i am a beginner)
any help will be appreciated...
When you declare a variable as unsinged it cannīt contain negative values. The advantage with declaring a variable as unsigned is that it can store larger values than signed.
E.i when you declara a varaiable as
& is used when you want to declare a reference (an alias) to an object.Code:unsigned char uc; //range from 0 - 255 signed char sc; // -126 to 127 (or something)
I think they are called inclusion gards. They are used so that e.i a class isnīt compiled twice (or more).& also what are the #ifdef & ifndef compiler directives used for??
Last edited by ripper079; 11-09-2002 at 05:45 AM.
This is if you've included the same headerfile twice.I think they are called inclusion gards. They are used so that e.i a class isnīt compiled twice (or more).
& is the refrence, you give it the address of a variable so you will be able to use it to access the variable, it's important when you call functions and pass an object to them, you use the refrence which prevent's making a copy of the objects, and saves momory.
Last edited by ammar; 11-09-2002 at 06:31 AM.
Perica,
As you can see, you need to be careful when writing out your questions. You'll probably want to be more judicious with using the ampersand (&) rather than the word, "and", in the future. (You had me a little confused, too.)
-Skipper
"When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow