Okay, so I'm still learning about C programming but I think I know what I've done wrong but I can't figure out how to fix it.

In my code, I'm trying to compare elements of an array (which is holding a string taken from a file via command line) in a for loop.
Code:
for( j = 0; inptr[ j ] != '\0'; j++ ) {
        --j;
}

if( inptr[j] == '\n' ) {
       --j;
}
However, I keep getting two invalid operands to binary errors. I'm pretty certain that you can compare elements of an array like this but I can't figure out how.

Thanks for your help!