2011-03-01 67 views
0

我想將str2打印到信箱,但沒有打印任何內容。這裏是代碼..如何將char []打印到消息框?

char str2[256]; 
    fstream file_op2("C:\\PROGRA~1\\executables\\path.txt",ios::in); 
    file_op2.getline(str2, 256); 
    file_op2.close(); 

    CString mycustompath; 
    mycustompath = str2; 
    MessageBox(NULL,mycustompath.GetBuffer() , L"read custom path", MB_OK); 

回答