我有以下代碼:C++轉換的int * LONG
STDMETHODIMP CWrapper::openPort(LONG* m_OpenPortResult)
{
string str("test");
const char * c = str.c_str();
m_OpenPortResult=Open(c); //this does not work because "Open" returns an int
return S_OK;
}
int Open(const char* uKey)
{
}
我不能轉換爲 「int」 爲 「LONG *」。 編譯器告訴我「‘詮釋’不能轉換爲‘LONG *’。
我也用INT *而不是LONG *試過了,但也給了我一個錯誤。
有人可以告訴我怎麼能轉換爲int長*或* INT?