看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC++ (VS2008) 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 不知道是哪邊設定錯誤?是unicode的關係嗎? 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): error C2440: '=' : cannot convert from 'const wchar_t [6]' to 'TCHAR' 程式碼(Code):(請善用置底文網頁, 記得排版) TCHAR* tchShmName; for(int i=1;i<=2;i++) { tchShmName[i] = TEXT("Shm%d",i); } 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.99.166.2
tomnelson::) 你沒發現你要塞的東西太大了嗎? 08/05 23:38
tomnelson:還有,你為tchShmName配置記憶體空間了嗎? 08/05 23:39
linotwo:不如就用 string 吧 http://codepad.org/MZaYOWuu 08/06 05:10
linotwo:注意陣列的第一個元素是從 0 算起 08/06 05:11