Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


C++ program filter_list
Author
Message
RE: C++ program #18
(12-01-2011, 01:04 PM)Frooxius Wrote: Not really. There's no converting really. All data in computer are basically ones and zeroes and how they are interpreted depends on the code. It can interpret them as characters, or as an image or sound or even an instruction (code). Characters are nothing but numbers, the char datatype is usually 1 byte, while int is 4 bytes. You can easily store the character in the integer, but function get() can't work with whole int, so by placing (char &) you only give it an address of the int, but it will think that it's a char, so it will see only one byte and store the character there. However, outside of this function, it's still the int type, you just "tricked" it into thinking that it's char and to store the character from the input in it.

I see now, thank you very much, you've been very helpfull! Kudos Smile
Everything you knew of, redefined.

Reply





Messages In This Thread
C++ program - by Diabolic666 - 11-25-2011, 06:11 PM



Users browsing this thread: 1 Guest(s)