Click here to Skip to main content
16,004,761 members

Comments by Goutham Mohandas (Top 3 by date)

Goutham Mohandas 19-Oct-12 8:42am View    
In the solution given by Cpallini, the statement 'ptr= &a;' diverts from where the ptr was orginally pointing. Eventhough, he points the ptr to the address of another pointer a(where a is an array of ints); which clearly satisfies my statement. :-)
Goutham Mohandas 19-Oct-12 8:24am View    
Segmentation fault may rise, because ptr[0] is not initialized, therefore, the assignment writes the value on the address ptr[0] holds by default.
Goutham Mohandas 19-Oct-12 8:16am View    
GCC version is gcc (GCC) 4.5.2