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

comparing arrays

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



Joined: 11 Sep 2008
Posts: 44

View user's profile Send private message

comparing arrays
PostPosted: Tue Oct 21, 2008 1:38 pm     Reply with quote

what is the quickest/easiest way to compare two single dimension integer arrays?

On that note, can strcmp be used for integer arrays?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 21, 2008 1:55 pm     Reply with quote

Strcmp looks for a string terminator byte of 0x00. It can't be used for
general purpose comparison of arrays.

Look at the memcmp() function in the CCS manual.
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf

The C language has a whole set of memxxxx() functions.
The CCS manual is not very extensive in explaining memcmp().
Do a Google search for this:
Quote:
memcmp in C
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