I'm currently porting some Fortran codes to C/C++ and **my question is**: How could I compare two dense matrices with the same dimensions?

For exampe,

...

ALLOCATE ( A( n,m ) )

ALLOCATE ( B( n,m ) )

...

A = 0

B = 0

...

! Some processing...

...**Could I use**:

...

IF A == B THEN

WRITE(*,"(A)"),'Matrix A equal to Matrix B'

ELSEIF THEN

WRITE(*,"(A)"),'Matrix A not equal to Matrix B'

ENDIF

...

Thanks in advance.