Compare to a defined constants in C?

Posted by J.W. on Stack Overflow See other posts from Stack Overflow or by J.W.
Published on 2010-12-26T21:56:25Z Indexed on 2010/12/30 22:54 UTC
Read the original article Hit count: 119

Filed under:

I am trying to compare to a defined constants in C, and I have simplified my program to the following..

#include "stdio.h"
#include "stdlib.h"
#define INVALID_VALUE -999;

int main(int argc, const char* argv[])
{
    int test=0;
    if(test==INVALID_VALUE) //The error line..
        return INVALID_VALUE;
    return 0;
};

And when I use gcc to compile. it gives out error "error: expected ‘)’ before ‘;’ token" Any reason that this cannot be done.

© Stack Overflow or respective owner

Related posts about c