#include <stdio.h>
#include <string>
int main(int argc, char* argv[])
{
char* pSrc = "13 23 33";
int nLength = strlen( pSrc );
char* pDest = NULL;
pDest = new char[nLength + 1];
memset( pDest, ' ', nLength + 1 );
char* pTmp = pSrc + nLength;
char* pDestTmp = pDest;
int nCount = 0;
while ( pTmp-- != pSrc )
{
if ( *pTmp == ' ' )
{
strncpy( pDestTmp, pTmp + 1, nCount );
pDestTmp += nCount;
//strncpy( pDestTmp, " ", 1 );
pDestTmp += 1;
nCount = 0;
}
else
{
nCount++;
}
}
strncpy( pDestTmp, pTmp +1, nCount );
pDestTmp += nCount;
*pDestTmp = '/0';
printf( pDest );
printf("/n");
return 0;
}