qUICK qUESTION

This is a discussion on qUICK qUESTION within the C++ Programming forums, part of the General Programming Boards category; Dies anyone know the algorithm to turn a ascii text into binary fromat. It would evwen be great if all ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    208

    qUICK qUESTION

    Dies anyone know the algorithm to turn a ascii text into binary fromat. It would evwen be great if all you did was point me to a tuorial on it. I need to know it for a program I am currently working on. Thanx.

  2. #2
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I've heard people talking about this with bit swapping and stuff like that. It was for that text game ErionD made. It used like >> operators and stuff. I never did figure out how they did it or anything.

    Are you trying to just encrypt something by making it binary, or do you have a special need? I'm just curious.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    208

    Encryption

    64 bit to be exact. i found this tutorial on it at cplusplus.com and they didn't explain how to do that ecause they said there was another tutorial on the site and there is not that I can find.

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    What do you mean by binary format?
    ASCII is simply characters represented by a number.
    if you want to get the value of a character use typecasting
    cout << (int)' ' << endl; will display 32 on the screen

  5. #5
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    Do as RpiMatty says you to and then use the returning value for to feed the ultoa() function.

    Now, just like he says, you may want to do this for a single character. For a string that simple ain't so unless you separate each byte of the string with a space of something. Otherwise you won't be able to get the string back... Why do you want to do this, by the way?
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

  6. #6
    Registered User
    Join Date
    May 2002
    Posts
    208

    What is that function

    and what header do I need to import I still consider myself a newbie. I am quite unfamilar with alot of different functions?

  7. #7
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I don't even know that function

  8. #8
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317

    Re: What is that function

    Originally posted by kas2002
    and what header do I need to import I still consider myself a newbie. I am quite unfamilar with alot of different functions?
    It's all in there. Just follow the link I gave you
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Very quick math question
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-26-2005, 11:05 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21