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

how to compare the string?

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







how to compare the string?
PostPosted: Fri Mar 28, 2008 1:11 am     Reply with quote

hi,
can anyone help me to do a program using strcmp?
below is my coding that already succes.
but when i burned to pic,the program didn't work as i want..

Quote:
unsigned short i[68];
//char input[77];
int ptr;
char in[]="$";
void main()
{
Usart_Init(4800);
// in = "$";

do {
if (Usart_Data_Ready()) // If data is received
{
i[68] = Usart_Read(); // Read the received data

ptr = strcmp(i, in);

if (ptr == 0)
{ Usart_Write('Y'); } // Send data via USART
else
{ Usart_Write ('N');}
}
} while (1);
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 28, 2008 1:26 am     Reply with quote

That's not CCS code. It's mikroC code. You should ask your question on
their forum:
http://www.mikroe.com/forum/
nhar
Guest







PostPosted: Fri Mar 28, 2008 1:46 am     Reply with quote

oh,sorry..
anyway,thanks for your respond.. Smile
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