How hard is C++ programming?

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

Was this solution helpful to you?

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

Just Added Q & A:

Find solution

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.