Possible Duplicates:
the role of #ifdef and #ifndef
How many and which are the uses of “const” in C++?
I am new to this field and I am just not getting certain functions or concepts.
For example, I have this code:
#ifdef directory
Now, we could use a simple if
condition in the program. So why is #ifdef
used? I don't get it.
I also have a question about const
. I have studied some papers, but they just explain how to use it but I did not find any reason why.
For example, this is not clear to me:
const void operator=(const point& other);
Here, I think this is a function called by reference. That means this function says that operator =
takes a reference to its argument so other
will behave as ordinary variable inside this function. And const
is used to indicate that the parameter will not change the actual value of the argument. But then why is const
used before void
?