The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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,326
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" <> wrote in message <h9inrd$ahr$>...
> "Tomas Schiler" <> wrote in message <h9ig2u$kuj$>...
> > 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.