How do I do this. I tried whit casting but the whole thing still evaluates to zero.
uint_64 a;
uint_32 b;
int c = a +b;
c will be zero right?
How do I do this?
Regards
Printable View
How do I do this. I tried whit casting but the whole thing still evaluates to zero.
uint_64 a;
uint_32 b;
int c = a +b;
c will be zero right?
How do I do this?
Regards
Both a and b are uninitialized, so whatever c happens to end up is undefined.
Quzah.
And uint_32 should be printed with %u.
uint64_t uses PRIu64
uint32_t uses PRIu32
Those are macros in inttypes.h If your compiler doesn't define those, it would probably be best to define them in a compiler-specific ifdef.
Assuming, of course, that you really mean uint32/64_t, and not uint32/64.