Originally Posted by DaWei
Wrecker, that is not correct. In your code, p is a pointer to an integer pointer. Dereferencing it will provide a value that is expected to be a pointer to an integer, not an integer. One can allocate the entire array in one swoop, as you show, but one can not then access it in 2D fashion, except by performing arithmetic manipulations involving multiplications by m.
Hey DaWei, actually the code posted works very fine and to tell you that this was the code used when i had won the national level programming competition. Also i didnot understaand why cant we access it in 2D fashin. I dont mean to say that M the only one who is correct but To the best of my knowledge m correct and code also......