unsigned char je tip koji definise varijablu koja uzima 1 bajt i uvek je pozitivna (dakle 0 do 255)
signed char je tip koji definise varijablu koja uzima 1 bajt i moze da bude negativna (dakle -128 do +127)
ako stavis samo int, u zavisnosti od kompajlere to moze da bude 2 ili 4 bajta varijabla i uvek je sa znakom, dakle -32768 do +32767 ili -2147483648 do +2147483647.
Ako stavis unsigned int onda je od 0 do +65535 ili 0 do +4294967295 (zavisno dal je 2 ili 4 bajta)
long integer je "veliki integer" i u zavisnosti od kompajlera je ili 2 bajta ili 4 bajta ili 8 bajtova i isto moze da bude i "signed" i "unsigned".
Po defaultu su svi signed (ako ne stavis nista), ali ako dodas unsigned ... jasno ..
ako ces da radis u mikroC - pogledaj help za "Fundamental Types", pa onda pogledaj "Arithmetic Types"
Citat:
The arithmetic type specifiers are built up from the following keywords: void, char, int, float and double, together with the prefixes short, long, signed and unsigned. From these keywords you can build both integral and floating-point types.
Integral Types
The types char and int, together with their variants, are considered to be integral data types. Variants are created by using one of the prefix modifiers short, long, signed and unsigned.
In the table below is an overview of the integral types – keywords in parentheses can be (and often are) omitted.
The modifiers signed and unsigned can be applied to both char and int. In the absence of the unsigned prefix, signed is automatically assumed for integral types. The only exception is char, which is unsigned by default. The keywords signed and unsigned, when used on their own, mean signed int and unsigned int, respectively.
The modifiers short and long can only be applied to int. The keywords short and long, used on their own, mean short int and long int, respectively.
Type Size in bytes Range
bit 1–bit 0 or 1
sbit 1–bit 0 or 1
(unsigned) char 1 0 .. 255
signed char 1 - 128 .. 127
(signed) short (int) 1 - 128 .. 127
unsigned short (int) 1 0 .. 255
(signed) int 2 -32768 .. 32767
unsigned (int) 2 0 .. 65535
(signed) long (int) 4 -2147483648 .. 2147483647
unsigned long (int) 4 0 .. 4294967295
Floating-point Types
The types float and double, together with the long double variant, are considered to be floating-point types. The mikroC PRO for PIC’s implementation of an ANSI Standard considers all three to be the same type.
Floating point in the mikroC PRO for PIC is implemented using the Microchip AN575 32-bit format (IEEE 754 compliant).
An overview of the floating-point types is shown in the table below:
Type Size in bytes Range
float 4 -1.5 * 1045 .. +3.4 * 1038
double 4 -1.5 * 1045 .. +3.4 * 1038
long double 4 -1.5 * 1045 .. +3.4 * 1038
Koliko sta zauzima, nemoj preterano da se opterecujes time. Kada iskompajliras kod on ti kaze koliko je kod velik, vremenom ces steci osecaj koliko je nesto veliko.
Na malim mcu-ima sve sto nije int kalkulacija zauzima mnogo mesta, dakle izbegavaj razlomljenje brojeve. Ako zadrzis matematiku u celobrojnom domenu neces imati problem