|
|
Re: convert mwsize * to int *
Posted:
Sep 25, 2009 1:03 PM
|
|
"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <h9inrd$ahr$1@fred.mathworks.com>... > "Tomas Schiler" <excal@atlas.cz> wrote in message <h9ig2u$kuj$1@fred.mathworks.com>... > > I am sorry that I didn’t express my problem clear enough. Function is written for 32 bit system but I am using 64 bit system now. > > > > I think you will need to provide more detail, or post some code, etc. to show us exactly what the issue is, and why simple type casts will not work. > > James Tursa
P.S. Basically, if you have a function that takes an int * as an argument, it is expecting an array of ints. If you have an array of mwSize on in the calling routine, and mwSize is different from an int, then you need to allocate an int array the same size as your mwSize array, copy the mwSize elements into the int elements, and then pass the pointer to the int array to the function, and when you are done then free the allocated int array. You can't convert the mwSize * itself to an int * and expect things to work by passing this pointer to the function, because the underlying data hasn't been converted.
James Tursa
|
|