VC向文件追加数据

来源:互联网 发布:网络作家富豪 编辑:程序博客网 时间:2024/06/05 12:50

CFile::SeekToEnd

CFile::Write

之前一直用的是CFile::modeCreate|CFile::modeReadWrite,今天才发现,If the file exists already, it is truncated to 0 length(也就是,如果文件存在,会将其截断成0字节),需要再加上CFile::modeNoTruncate——If the file being created already exists, it is not truncated to 0 length.