User Profile

Collapse

Profile Sidebar

Collapse
diadomraz
diadomraz
Last Activity: Nov 20 '08, 02:22 PM
Joined: Nov 16 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • diadomraz
    replied to byte vs char
    in C
    Thanks, guys!

    I fiddled with this some more over the weekend and found out that the following code works for me. Thought I would post this in case somebody is fighting with the same...
    ---------------------
    template <class T>
    class byte_templ {
    T v;

    public:
    byte_templ<T>() : v() { }
    byte_templ<T>(c onst T &w) : v(w.v) { }
    byte_templ<T>(c onst...
    See more | Go to post

    Leave a comment:


  • diadomraz
    started a topic byte vs char
    in C

    byte vs char

    Hi,

    This is a question about declaring a signed 8bit numeric type in C++ that prints like a numeric variable and not like a char variable. I would like to declare a type with name 'byte' which represents 8bit numeric values. Of course C++ has char with the right size. So I tried
    ------
    typedef char byte;
    ------
    This is fine, until I tried
    ---------
    byte b = 1;
    cout << b;
    ...
    See more | Go to post
No activity results to display
Show More
Working...