-2
如何將LPVOID轉換爲char?將LPVOID轉換爲CHAR ERROR C2440:=
char * pCacheMap;
pCacheMap = MapViewOfFile(hCacheMapping,FILE_MAP_READ|FILE_MAP_WRITE,0,0,0);
錯誤:
3 IntelliSense: a value of type "LPVOID" cannot be assigned to an entity of type "char *"
Error 1 error C2440: '=' : cannot convert from 'LPVOID' to 'char *'
那個錯誤信息中的內容不清楚?像從C這樣的語言中可以預料,沒有從'LPVOID'到'char *'的隱式轉換。C++將需要強制轉換。 – WhozCraig