# Help with Fortran to C++ conversion

Hello, i have this in fortran:

DO 110 J=1,6

DO 130 K=1,6
&     .AND.( (.NOT.LMASK(1)) .OR. (ABSA(K).GE.ABSA(1)) )
&     .AND.( (.NOT.LMASK(2)) .OR. (ABSA(K).GE.ABSA(2)) )
&     .AND.( (.NOT.LMASK(3)) .OR. (ABSA(K).GE.ABSA(3)) )
&     .AND.( (.NOT.LMASK(4)) .OR. (ABSA(K).GE.ABSA(4)) )
&     .AND.( (.NOT.LMASK(5)) .OR. (ABSA(K).GE.ABSA(5)) )
&     .AND.( (.NOT.LMASK(6)) .OR. (ABSA(K).GE.ABSA(6)) )  )
&                          IPIV = K

I don't know how would you express that if statement in C++.

Thank You
###### Who is Participating?

Commented:
for (int k = 0; k != 6; ++i)

for (int k = 0; k != 6; ++i)
&& (!LMask[0] || (Absa[k] >= Absa[0]))
&& (!LMask[1] || (Absa[k] >= Absa[1]))
&& (!LMask[2] || (Absa[k] >= Absa[2]))
&& (!LMask[3] || (Absa[k] >= Absa[3]))
&& (!LMask[4] || (Absa[k] >= Absa[4]))
&& (!LMask[5] || (Absa[k] >= Absa[5])))
ipiv = k;

This assumes that ABSA is another array and that you have it defined in your C++; that that out of context I could have otherthings that are not quite right but the basics should be there.
0

Commented:
Oh, yeah, declare

int ipiv;

before the second loop starts.

-bcl
0

Commented:
And the last line of the code should read

-bcl
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.