how to omit extra bits in a file?

Posted by thinthinyu on Stack Overflow See other posts from Stack Overflow or by thinthinyu
Published on 2010-06-07T04:05:53Z Indexed on 2010/06/07 4:12 UTC
Read the original article Hit count: 325

Filed under:

I want to omit extra bit in txt file.eg ....ÿ 0111111110111101100011011010010001 in this string we want to omit extra bit "ÿ " which is appeared when we save a binary string. Save fun is as follow. please help me.

void LFSR_ECDlg::Onsave() { this->UpdateData();

CFile bitstream;
char strFilter[] = { "Stream Records (*.mpl)|*.mpl| (*.pis)|*.pis|All Files (*.*)|*.*||" };

CFileDialog FileDlg(FALSE, ".mpl", NULL, 0, strFilter);



if( FileDlg.DoModal() == IDOK )
{
    if( bitstream.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite) == FALSE )
        return;
    CArchive ar(&bitstream, CArchive::store);


    CString txt;
    txt="";
    txt.Format("%s",m_B);//by ANO
    AfxMessageBox (txt);//by ANO
    txt=m_B;//by ANO
    ar <<txt;//by ANO

    ar.Close();
}
else
    return;

bitstream.Close();

© Stack Overflow or respective owner

Related posts about c++