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...
User Profile
Collapse
-
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;
...
No activity results to display
Show More
Leave a comment: