### Thread: Ignore a particular element?

1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Feb 2012
Posts
24
Rep Power
0

#### Ignore a particular element?

Hello,
i have a small problem in this function code.I want when the IN[n]+1 become bigger than 4 to ignore in this particular n the P[n].VALUE and P[n].LINE.
Can you help me?

Code:
```int compair_value()
{
int min,i,c,j;
for(n=0;n<4;n++){
IN[n]=0;
}

for(c=0;c<20;c++){
for(n=0;n<4;n++){
IN[n]=P[n].LINE;
P[n].VALUE=A[n][IN[n]];
}

min=P[0].VALUE;
for(j=0;j<4;j++){
if(min>P[j].VALUE)
{
min=P[j].VALUE;
}}
for(n=0;n<4;n++){
if(min==P[n].VALUE){
P[n].LINE=IN[n]+1;
B[c]=P[n].VALUE;

}}

}

}```
2. It would help if you could indent code.
Code:
```int compair_value()
{
int min, i, c, j;
for (n = 0; n < 4; n++) {
IN[n] = 0;
}

for (c = 0; c < 20; c++) {
for (n = 0; n < 4; n++) {
IN[n] = P[n].LINE;
P[n].VALUE = A[n][IN[n]];
}
min = P[0].VALUE;
for (j = 0; j < 4; j++) {
if (min > P[j].VALUE) {
min = P[j].VALUE;
}
}
for (n = 0; n < 4; n++) {
if (min == P[n].VALUE) {
P[n].LINE = IN[n] + 1;
B[c] = P[n].VALUE;
}
}
}
}```
> I want when the IN[n]+1 become bigger than 4
Code:
```if ( IN[n]+1 <= 4 ) {
// do stuff
}```
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Feb 2012
Posts
24
Rep Power
0
thank you for the quick answer but IN[n]<=4 do what??
4. > thank you for the quick answer but IN[n]<=4 do what??
If you're asking that, how did you manage to write all that code to begin with!?
5. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Feb 2012
Posts
24
Rep Power
0