Why is this valid:
int main()
{
double good; good++;
return 0;
}
but this is not:
int main()
{
double good++;
return 0;
}
I know that normally you want to initialize variables to some value before increment it (because then it'd just contain random garbage from memory), but I'm just curious why the latter does not allow this. Doesn't the post-increment operator, happen after the value is returned? It would make sense for ++good not to work, but I don't understand why good++ doesn't.