|
From: Ioannis V. <iv...@at...> - 2003-04-29 14:00:32
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Esteban Valverde > Sent: Tuesday, April 29, 2003 4:22 PM > To: dev-cpp > Subject: [Dev-C++] Doble pointer > > > Hi, I can do this: > > int array [ N ]; > int *p = array; > > but I can't do this: > > int matrix [ M ] [ N ]; > int **q = matrix; > > An "suspicius pointer conversion" warning message appear and > the program > halts when I run it. Why can't do this assigment ? Because that is a pointer to pointer. You need a pointer to array, that is: int (*q)[N]=matrix; or int (*q)[N]=&matrix[0]; Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |