04-26-2010 12:26 AM
Hallo NI,
Several years ago I have worked with MS Visiual C++ and CVI5.5. Duing this time I developed a program which used the swap()-routine out of MSVC++-lib. Now I want to redevelop this program without using MSVC++. Is there any lib which uses the swap-routine in CVI 8.5?
04-26-2010 12:51 AM
In CVI, there is no swap command, however, the Tools library provides the SwapBlock function to swap the contents of two blocks of memory. Another possibility is to define a macro.
04-26-2010 03:08 AM
04-26-2010 03:23 AM - edited 04-26-2010 03:24 AM
How hard can it be? Let's see...
void _swab( char *src, char *dest, int n )
{
// Assumes n is even. Add appropriate code if it may be odd.// Also assumes src and dest are not the same
int indx;
for (indx=1; indx<n; indx+=2)
{
dest[indx-1] = src[indx];
dest[indx] = src[indx-1];
}
}