J
joye
Dear All,
Many old C standard library is useful for string operation such as strcpy.
But I meet some problem, a managed char array which declared in a structure
and this structure has a instance declared in a__gc class.
Sample code as following,
namespace Configure
{
using namespace System ;
typedef struct _SW{
char szVersion[64] ;
} SW,*PSW ;
public __gc class Config{
private :
SW m_sw ;
public :
Config() { strcpy(m_sw.szVersion,"1.0.0.0") ; }
} ;
}
There is a complier error at strcpy() function: Can't conver char[64] to
char *.
My question is how to conver this managed char array to char* , thus, I can
use the standard C lib such as strcpy(), and strcat().
Does any can tell me the solution? Thank you very much.
Regards,
Tsung-yu
Many old C standard library is useful for string operation such as strcpy.
But I meet some problem, a managed char array which declared in a structure
and this structure has a instance declared in a__gc class.
Sample code as following,
namespace Configure
{
using namespace System ;
typedef struct _SW{
char szVersion[64] ;
} SW,*PSW ;
public __gc class Config{
private :
SW m_sw ;
public :
Config() { strcpy(m_sw.szVersion,"1.0.0.0") ; }
} ;
}
There is a complier error at strcpy() function: Can't conver char[64] to
char *.
My question is how to conver this managed char array to char* , thus, I can
use the standard C lib such as strcpy(), and strcat().
Does any can tell me the solution? Thank you very much.
Regards,
Tsung-yu