How i can conver English Text in to Binary Language ic C or C++ programming?
-
If i am inputing "Hello" and if i want to convert that word in to Binary than is there any methematical process which support either C or C++ programming language. If you know than please tell me and try to help me. Please tell me the whole procedure to convert Text to Binary in C or C++ programming. I am waiting for the good and well explained answer. Thanks.
-
Answer:
I understand you want to convert A,B,C... to {0,1}, right? then. In C, all strings are character arrays, otherwise collection of characters. by converting each character u can do. as u can see each character both printable and other have a numerical value. it is in a table, ASCII table. Here the code ---------- void binary(char ch) { if(ch>0) binary(ch/2); printf("%d",ch%2); } void toBinary(char*text) { for(i=0;text[i]!='\0';i++) { binary(test[i]); printf("\n"); } } ---------- i hope these two functions helps you..... good luck.
ankz_u at Yahoo! Answers Visit the source
Other answers
It has been a while that I have written any C programs so please read my reply with caution ! I am replying just because I was so fond of this language during my college days ;-) The answer give by person before me is right if you really wanted to have binary representation of english characters; If you meant ASCII representation(a=32,A=65 etc.) then here is how you can achieve it. In C there are plenty of ways you can achieve it 1) Characters can be printed as numbers by using format specifiers printf("%d%d%d%d%d",'h','e','l','l','o… 2) char c='h'; int a=c; a will have the ASCII number for character in question
bhavesh
Binary is 1's and 0's. English is a language. Text to a computer is also known as a character set. For you to convert a character a into its binary you need to understand the conversion table. The character set that you are probably interested in is ASCII. which consists of both printable and non printable characters. Almost every programming language can convert between ASCII and hex, or ASCII and binary.
explicit_intents
I don't know about C or C++, but I know of a good text to binary and binary to text converter...
digitalgimpling
Related Q & A:
- How I can get a cheap train ticket from Munich to Saarbrucken for September? How much is it you think?Best solution by Yahoo! Answers
- How i can change language in yahoo mail box?Best solution by Yahoo! Answers
- Can you share some tips on how I can preserve my collection of paintings?Best solution by Yahoo! Answers
- How I can change Yahoo page language?Best solution by Yahoo! Answers
- Can anyone suggest how I can improve myself?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.