954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

String to Bitstream

How to convert strings to bitstream?

ankitrastogi82
Newbie Poster
11 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I'm sorry, I tossed out my crystal ball years ago. You'll have to be more specific instead of expecting us to read your mind. As given, your question is ambiguous.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

I just mean to say that I have some string and I want to convert it in a stream of bits.
Is there any function availaible in C++ which can do that. e,g
str = "A";
is represented as 1010 in bits .

Hope now you get me :o)

ankitrastogi82
Newbie Poster
11 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

There is a function in C++ that does what you want. But it might not have been written for you. So you're going to have to write it yourself.

You should also try figuring out _exactly_ what you are trying to do. Right now, you are being ambiguous. After all, a string is already a stream of bits! Also, your example of converting "A" to 1010 makes no sense to me at all. Why would "A" be converted into the stream 1010?

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You