I'm trying to create a custom data type for a project I'm working on. The idea is that the datatype will be a "serial" number that looks something like: 0x010000305 ...you get the idea.
I want to be able to say Serial mySer = 0x010000305; Not sure how to do this. Help?

1 answers
This should get you started:
answered 2 years ago by:
17279
121
Serial mySer = 0x012345; prints: 0x12345
17279
There's no difference between 0x012345 and 0x12345 - they're the same hex number. However, if you want to always print the number with a certain minimum number of digits (say 6), zero-filled to the left, then change "X" to "X6".