Code your App,Advertise,Sell your App,All in one platform...
Go to Link
Penetration Testing,Tools,Tutorials,Programing,Leaks,and more..
C#,C++,VB,Java,Powershell,Bash,and more..
0 Members and 1 Guest are viewing this topic.
Converts Text Into Binary. (Using The Division Method Through ASCII Code).=======================================================#include <iostream>#include <cstring>#include <cstdlib>using namespace std;//Varaible Declarationchar *Entry, Letter, Choice[2];int Ascii, len, Binary[8], Total;void Convert();int main(){ Convert(); return 0;} void Convert(){ Entry = new char[501]; cout << "Enter Text To Convert(Up To 500 Chars): "; cin.getline(Entry, 500); len = strlen(Entry); for(int i = 0; i < len; i++) { Total = 0; Letter = Entry[i]; Ascii = Letter; while(Ascii > 0) { if((Ascii%2)==0) { Binary[Total] = 0; Ascii = Ascii/2; Total++; } else { Binary[Total] = 1; Ascii = Ascii/2; Total++; } } Total--; while(Total >= 0) { cout << Binary[Total]; Total--; } } delete[] Entry; //Freeup Memory return 0;}