This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Help on Biset


Hi,
I am fairly new to the list. If you think that I am saying something
stupid, please do correct me.
  I am trying to use stl bitset with gcc. However, I found that the
.to_string() method is not implemented.

  Here is the code I was trying to run,

#include <fstream>
#include <bitset>
int main(){
   ofstream out;
   out.open("bittry.txt");
   int i = 97;
   bitset<12> set1(i);
   out << set1.to_string();
   out.close();
   return 1;
}

  What I need to do is to try to output one bit at a time to a file... I
am trying to make a binary file(for example, "011" will be outputted as
bits "011", not string "011" to a file).
  Please let me know if it is a but of Gcc and if it is, is there
anyways to get around it?

Thanks,
-- 
--
Yan
...
KeyServer: pgp.mit.edu; Index ID: s8li
Key fingerprint = 41B8 FD05 6598 A34A D564  EA73 F1DA 32F2 9EC2 DB0B
Dream as if you'll live forever; 
Live as if you'll die tomorrow.

-------------------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]