| 发表于:2007-03-01 11:43:10 楼主 |
大家好,本人是菜鸟,有以下疑问, cstring szfilename = filedlg.getnextpathname(pos); char *pbuf; cfile file; file.open(szfilename,cfile::moderead ¦cfile::typebinary); dword dwfilelen; dwfilelen=file.getlength(); pbuf=new char[dwfilelen+1]; pbuf[dwfilelen]=0; file.read(pbuf,dwfilelen); int temp = atoi(pbuf); file.close(); cstring tempstring; tempstring.format( "%d ",temp); messagebox(pbuf); messagebox(tempstring); 1.二进制文件以文本方式打开是乱码,读取后用messagebox显示的和文本是一样,也是乱码,可我要读取的是灰度值,应该是数字才对啊。 2.如何显示这些数字,为什么temp总是0,希望老手们帮忙啊 |
|
|
|
|