   argument and variable with the same name?
  I once saw some code that does stuff like thisclass Foo{    bar b;   public:    Foo(bar b): b(b) {}};How can it have an argument with the same name as a member variable? It's confusing. When you type b, how does the compiler know which one to refer too?   
  When you refer to b inside Foo's constructor it's the argument, if you need the b member variable you can refer to it using the keyword this.e.g this->b   ;  In an initialiser list, you cannot initialise the argument (it doesn't make any sense to do so anyway). So it knows that anything in the form : <name>(/* ... */) is a member initialisation. Other than that, the standard lookup rules follow for the initialisation expression, so it does not initialise the member with itself.   ;  This is a consistency of <insert-term> rules. (I'm not sure whether i should say lookup rules or variable scope rules or what-not.)int x = 10;void f( int x ){    cout << x << ' ';}struct T{    int x;    T( int x ) : x( 10 )    {   f( x );    }};int main(){    f( 5 );   // 5 is printed    T t( 5 ); // 5 is printed}In T's ctor, x refers to the most local thing named x, which is the argument. As rip-off noted, x( 10 ) is in the initializer list and therefore treated differently.   ;  This is common practice for a lot of people and is in fact guaranteed to work. The one outside the brackets is always the member variable, and the one inside is always the argument.It saves having to make up different names for your constructor arguments, which would otherwise just be an annoyance.   