dimanche 2 septembre 2018

How to take input from a raw12 file in cpp? I tried by opening it in binary mode than using getline and display but did not work?

I have a raw-12 file , I want to take input of 12-bit at a time and then convert it to in 8-bit in c++.
This is how i am taking input.

int main()
{   
     string s;
     fstream f ("pagan.raw12", std::ios::binary|std::ios::in);
     if (!f)
         std::cout<<"\n oops!! file does not exit";
     else
         std::cout<<"\n ready to go!!"

     std::cin.ignore();

     getline(cin,s);

     std::cout<<s;

     f.close();

     return 0;
}

Aucun commentaire:

Enregistrer un commentaire