View previous topic :: View next topic |
Author |
Message |
chriss2000 Guest
|
Array Problems ! |
Posted: Tue Feb 11, 2003 5:10 am |
|
|
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 ! |
Posted: Tue Feb 11, 2003 9:33 am |
|
|
:=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 ! |
Posted: Tue Feb 11, 2003 10:30 am |
|
|
:=:=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 ! |
Posted: Tue Feb 11, 2003 10:33 am |
|
|
:=:=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 |
|
|
|