Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: convert mwsize * to int *
Replies: 10   Last Post: Jan 8, 2013 2:37 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
James Tursa

Posts: 2,096
Registered: 8/5/09
Re: convert mwsize * to int *
Posted: Sep 25, 2009 1:03 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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&#8217;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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.