Recently, I was looking through the source code of the app written in India(Bangalore) and I found those lines of code:
1 2
private:
#define TIME_OUT 20000
I have the only question: What a hell? How does the author of those lines of the code written above intend to do the preprocessor "private"? O_o Am I missing something?
p.s. it's C++. Or it looks like...........................
There is no any relation between line private: and the macro definition. The only meaning that the macro will be known for the preprocessor after the line with private:.
IMO it is a very bad style of programming,
when the preprocessor run, it will replace TIME_OUT with 20000. it does not matter where you define it. Here may be developer was thinking that TIME_OUT will not be visible outside the class, but this is not correct. We can access TIME_OUT out side the class
class A
{
private :
#define TIMEOUT 20000
};