+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2008
    Location
    PA
    Posts
    1,164
    Points
    3,852,881.25
    Rep Power
    220

    Default Text To Hex Converter[C++]

    This is similar to my Char to hax/deci but u can do a string such as a word the value generated is same value as u would see in nitepr or ps2dis
    Code:
    /*
      Name: Text Converter
      Author: SonniE
      Date: 02/06/08 04:30
      Description: www.codinghs.com original program
    */
    
    #include <iostream>
    #include <string>
    using namespace std;
    int main()
    {
         char text[16];
         char ans, var;
         cout << "Welcome TO SonniE's Text To Hex! A WWW.codinghs.COM Original\n";
    here:
         var = 0;
         cout << "Enter Your Text: ";
         std::cin>>text;
         std::cout << "Text: "<< text <<"\nHexadecimal Value: "; 
         do{
                  cout<< hex << int(text[var]);
                  var++;
                   }while (text[var] != '\0');
         cout<< "\n";
         system("PAUSE");
         cout << "Do You Want To Convert Another Character? (y/n)";
         cin >> ans;
         if (ans == 'y' || ans == 'Y')
         {
                 system("cls");
                 goto here;
         }
         else 
         {
              system("pause");
         }
         return 0;
    }
    Heres An Example of this app in action
    Code:
    Welcome TO SonniE's Text To Hex! A WWW.codinghs.COM Original
    Enter Your Text: SonniE
    Text: SonniE
    Hexadecimal Value: 536f6e6e6945
    Attached Files


    Get Vip: »Here«
    Donate: »Here«
    >>List of Compilers<<
    >>SFDM Name Generator<<
    [Owner Of FluidCoding]

  2. #2
    Join Date
    May 2008
    Location
    In the interwebz
    Posts
    5,057
    Points
    1,446,212.99
    Rep Power
    231

    Default

    Neat app, could be useful. +REP (if i can now....)

  3. #3
    Join Date
    Apr 2008
    Posts
    20
    Points
    175,263.00
    Rep Power
    208

    Default

    Nice Man i gotta start learning C++

  4. #4
    Join Date
    Feb 2008
    Posts
    376
    Points
    1,087,499.33
    Rep Power
    215

    Default

    it apparently does not like spaces. nice job though

  5. #5
    Join Date
    Feb 2008
    Location
    New York
    Posts
    3,114
    Points
    2,749,637.34
    Rep Power
    226

    Default

    ^haha i was gunna post about the spaces to...ya beat me to it

  6. #6
    Join Date
    May 2008
    Posts
    4
    Points
    40.00
    Rep Power
    207

    Default

    hows about a hex to decimal converter..


    eg:

    #include <iostream>
    #include <iomanip>
    #include <string>

    using namespace std;

    int main( void )
    {
    string prompt = "Enter a hex value to convert, 0 to exit\n>";
    int val;

    do
    {
    cout << prompt;
    cin >> hex >> val;
    cout << "\n" << hex << val << " -> " << dec << val << "\n";
    } while( val );

    return 0;
    }

  7. #7
    Join Date
    May 2008
    Location
    In the interwebz
    Posts
    5,057
    Points
    1,446,212.99
    Rep Power
    231

    Default

    Quote Originally Posted by JamakianGangster View Post
    lol, this is all confusing
    What's there to be confused about?

  8. #8
    Join Date
    Jan 2008
    Location
    PA
    Posts
    1,164
    Points
    3,852,881.25
    Rep Power
    220

    Default

    Quote Originally Posted by SilverSurfer View Post
    hows about a hex to decimal converter..


    eg:

    #include <iostream>
    #include <iomanip>
    #include <string>

    using namespace std;

    int main( void )
    {
    string prompt = "Enter a hex value to convert, 0 to exit\n>";
    int val;

    do
    {
    cout << prompt;
    cin >> hex >> val;
    cout << "\n" << hex << val << " -> " << dec << val << "\n";
    } while( val );

    return 0;
    }
    nice job silver i might play with ur style later


    Get Vip: »Here«
    Donate: »Here«
    >>List of Compilers<<
    >>SFDM Name Generator<<
    [Owner Of FluidCoding]

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts