I am using Visual Studio 2015 to learn some basic C. While experimenting with the EOF symbolic constant, I decided to lookup its definition and this is what I found:
#define EOF (-1)
I though it was kind of weird that the -1 was enclosed in parenthesis so I decided to create my own -1 symbolic constant so I did the following:
#define ABC -1
In the debugger, both EOF and ABC show as value -1 so I started wondering, why does the EOF definition uses (-1)
to represent -1
when the parenthesis do not appear to be needed?
Thanks.