I know what the command does:
If I write in main matrix c(3), I get an array c from type double with 9 spaces.
But I do not understand for what ...(int __n=0) : n(__n) {if (n)...
stands for.
Can someone helps me interpreting it ?
Thanks a lot,
stubborn
thank's a lot for your answer.
yes, the :n(__n) part is the first thing confusing me.
The link will help for understanding initializing lists.
The other thing is the part of the if-order.
I know requests like if (n=3) or if (n=true) ore other more complicated requirements.
But what means if (n) in that context ?
n is nowhere declared.
First off, you're using the wrong equals in your examples. You probably meant the equality operator (==) instead of assignment. :P
Most basic types (read: basic types like int, char, pointers, and the like) in C++ implicitly cast to bools the following way:
If they're zero, then as booleans they're false.
If they are nonzero, then as booleans they're true.
Basically, that if statement is a shortened way of checking if n is not zero.