![]() |
How to creat two dimension array in the heap
Hi All
I'm using MS-VStudio 2005and want to creat two dimension array in the heap(free store ) but when i write the code float *pFloat; pFloat=new float[3][5]; and compile the profram i got the following error error C2440: '=' : cannot convert from 'float (*)[5]' to 'float *' 1>Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast so could someone please tell me what's wrong in my code |
Re: How to creat two dimension array in the heap
You have posted it as an Article under the Article / Source code section. I have moved it to the Queries and Discussion forum. Please take care that you don't repeatedly post the query as an article.
|
Re: How to creat two dimension array in the heap
Thanks and sorry
|
Re: How to creat two dimension array in the heap
Code:
float (*pFloat)[5] = new float [3][5]; |
Re: How to creat two dimension array in the heap
Thanks
i will try it and if i have any notes i will post it |
Re: How to creat two dimension array in the heap
Please DaWei
when i tryed the code u suggested float (*pFloat)[5] = new float [3][5]; in my code i got this error error C2040: 'pFloat' : 'float (*)[5]' differs in levels of indirection from 'float *' So what's wrong do u have any suggestions[I] |
Re: How to creat two dimension array in the heap
http://support.microsoft.com/kb/104639 should cover all the problems involved and the workarounds.
|
Re: How to creat two dimension array in the heap
Works for me. Perhaps you have defined it otherwise, elsewhere.
|
| All times are GMT +5.5. The time now is 17:43. |