CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

function return int1?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Micronet666



Joined: 28 Aug 2019
Posts: 5

View user's profile Send private message

function return int1?
PostPosted: Sat Sep 07, 2019 8:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 07, 2019 8:38 am     Reply with quote

There is no 1-bit memory space in the PIC. The smallest addressable
unit in the PIC's RAM memory space is a byte.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Sep 07, 2019 6:54 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group