I am sorry for the poor representation. Your above solution explicitly type casts it . That is fine .
In C when you pass z or &z it takes the same address i.e the address of the first element . But when you allocate the memory through malloc then it shows different addresses . This was the result i saw with gcc. Is this compiler specific , as i have never seen that before.