Electronics > Beginners
sbit data type in mikro C pro
(1/1)
khatus:
What does it mean by " in a unit" ??
Ian.M:
A unit, colloquially compilation unit, but officially translation unit is one fully expanded C source file as seen by the compiler *AFTER* all preprocessing is complete. See https://en.wikipedia.org/wiki/Translation_unit_(programming)
N.B this has absolutely nothing to do with the MikroC propitiatory and non-standard sbit type or sfr qualifier except that a variable's definition and declaration using them apparently follow the same scope rules as any other C variable.
Siwastaja:
Unit is a compilation unit, basically the .c file where this line resides in. Declaring something in the unit with the extern keyword means that this unit (the c file), after this line, knows about the existence of such variable, and you can use it, but it is defined somewhere else.
Navigation
[0] Message Index
Go to full version