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 support@ccsinfo.com

error "A numeric expression must appear here"

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







error "A numeric expression must appear here"
PostPosted: Tue Jun 24, 2003 3:04 pm     Reply with quote

hello,
I'm having problems trying to do some simple arithmetic. I have the following piece of code that is giving me errors:

void write1wire(int byte){
int i; //counter
int bit; //holds value of last bit in byte

bit=byte\%2; //********ERROR HERE*********//
For (i=1; i<=8; i++){
if (bit == 1){
output_low(DQout);
delay_us(1);
output_high(DQout);
delay_us(60);
}
else {
output_low(DQout);
delay_uS(60);
output_high(DQout);
}
byte = byte/2; //********ERROR HERE*********//
}
}

I get an error saying "A numeric expression must appear here" at the both errors. Does anyone know why this is?

Thank you,
mle
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515539
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: error "A numeric expression must appear here"
PostPosted: Tue Jun 24, 2003 3:43 pm     Reply with quote

:=hello,
:=I'm having problems trying to do some simple arithmetic. I have the following piece of code that is giving me errors:
:= bit=byte\%2; //********ERROR HERE*********//
-------------------------------------------------------

"byte" is a defined keyword for CCS. You shouldn't use it.

Look in the 16F877.h file (or any other header file)
and you'll see it defined as an alias for "int".
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515540
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