hi
I have a function that returns an int1 (boolean value).
But when I bring the mouse pointer over the name of the function I see that it shows me that an int8 returns, then that doubt arises, a function can return a Boolean value?
thanks _________________ Programmer Microcontroller
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sat Sep 07, 2019 8:38 am
There is no 1-bit memory space in the PIC. The smallest addressable
unit in the PIC's RAM memory space is a byte.
YES a function can return a boolean( zero or one ), several CCS builtin functions do that and I just made my own 'function' test.
While the function returns a boolean, it is STORED in a byte, the smallest RAM location for a PIC. Therefore you can have 8 booleans in a byte. The compiler simply 'assigns' a bit of a byte for you.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum