> That won't work. 'buffer' goes away at the end of the function call, so
> the result is undefined behavior. (i.e. you have a bug in your code
> that depends on the stack not being modified when you go to read it
> later).
>
oh yes, thanks for the hint. It worked in my case, but i can see the
problem...was jut lucky. i guess this should be better:?
Thanks again!
float someFloatThatNeedsSwapping;
floatSwap2 (&someFloatThatNeedsSwapping);
void floatSwap2(float* f)
{
char* value = (char *)f;
char buffer[ 4 ];
buffer[0] = value[3];
buffer[1] = value[2];
buffer[2] = value[1];
buffer[3] = value[0];
*f = *(float*)&buffer;
};
>
> --
> Thomas Hruska
> CubicleSoft President
> Ph: 517-803-4197
>
> *NEW* MyTaskFocus 1.1
> Get on task. Stay on task.
>
> http://www.CubicleSoft.com/MyTaskFocus/
>
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]