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

Array Problems !

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







Array Problems !
PostPosted: Tue Feb 11, 2003 5:10 am     Reply with quote

hi
i want to compare the long int "code" with an array of 4 long integer
how can i do this ?

long const werte [4] = {
0x3800,0x3000,
0x3801,0x3001
};
????
if(code == werte [i])
{

}
___________________________
This message was ported from CCS's old forum
Original Post ID: 11514
zag
Guest







Re: Array Problems !
PostPosted: Tue Feb 11, 2003 9:33 am     Reply with quote

:=hi
:=i want to compare the long int "code" with an array of 4 long integer
:=how can i do this ?
:=
:=long const werte [4] = {
:= 0x3800,0x3000,
:= 0x3801,0x3001
:= };
:=????
:=if(code == werte [i])
:={
:=
:=}


for (i=0;i<3;i++)
if(code == werte[i])
/*Your code*/

If I have understood the problem.
Byez
___________________________
This message was ported from CCS's old forum
Original Post ID: 11529
Dale Botkin
Guest







Re: Array Problems !
PostPosted: Tue Feb 11, 2003 10:30 am     Reply with quote

:=:=hi
:=:=i want to compare the long int "code" with an array of 4 long integer
:=:=how can i do this ?
:=:=
:=:=long const werte [4] = {
:=:= 0x3800,0x3000,
:=:= 0x3801,0x3001
:=:= };
:=:=????
:=:=if(code == werte [i])
:=:={
:=:=
:=:=}
:=
:=
:=for (i=0;i<3;i++)
:= if(code == werte[i])
:= /*Your code*/
:=
:=If I have understood the problem.
:=Byez
___________________________
This message was ported from CCS's old forum
Original Post ID: 11534
Dale Botkin
Guest







Re: Array Problems !
PostPosted: Tue Feb 11, 2003 10:33 am     Reply with quote

:=:=hi
:=:=i want to compare the long int "code" with an array of 4 long integer
:=:=how can i do this ?
:=:=
:=:=long const werte [4] = {
:=:= 0x3800,0x3000,
:=:= 0x3801,0x3001
:=:= };
:=:=????
:=:=if(code == werte [i])
:=:={
:=:=
:=:=}
:=
:=
:=for (i=0;i<3;i++)
:= if(code == werte[i])
:= /*Your code*/

Or:

for (i=0;i=sizeof(werte)/2;i++) {
if(code == werte[i]) {
/*do whatever*/
}
}

I think...
___________________________
This message was ported from CCS's old forum
Original Post ID: 11535
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