When browsing the source of a project on web I’ve found some return statement in main that looks weird to me:
int main()
{
/* ... */
return 0x1;
}
So main is returning 0x1 radix 16, but that’s 1 radix 10! Shouldn’t main return 0?
That is incorrect, right? By the way is it Okay to return 0x0?
It returns 1.
0x1Is just a hex value of 1.You are free to return 0x0, too. It’s just a different representation of 0. You could use octal, too, if you like 🙂