Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In the code listing on the 4th page [0], why is MaxGThreads and StackSize wrapped in an enum? I would use an enum when I might want some values to be mutually exclusive. Seems like these values aren't even used in the same context? I would use static const ints.

[0] https://c9x.me/articles/gthreads/code0.html



Because in C (as opposed to C++), a static const int is not a compile-time constant (so you can't use it in places like switch case labels).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: