First thing's first: how to declare a 64-bit integer. You shouldn't need any header files to do this, depending on your compiler. (I use Microsoft Visual C++)
Those are two underscores.
To use a 64-bit integer in a format function (such as sprintf or printf) we use the following format code:
For signed values: %I64Ld
For unsigned values: %I64Lu
Next: how to convert a string into a 64-bit integer. It's a pretty much like other ato* functions, which are located in stdlib.h. Here's the prototype:
__int64 _atoi64(const char *);
For example, this is how we could create and print a 64-bit integer.
unsigned __int64 EighteenQuintillion = 18000000000000000000;
NineQuintillion = 9000000000000000000;
printf("My first 64-bit integer is %I64Ld!\n", NineQuintillion);
printf("My second 64-bit integer is %I64Lu!\n", EighteenQuintillion);
Signed 64-bit integers have a range of:
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
Unsigned 64-bit integers have a range of:
0 to 18,446,744,073,709,551,620
That's almost 18 and a half quintillion!
As you can see, 64-bit integers are as simple as the other data types. They don't require any snazzy functions to get the job done, they just have slightly different naming conventions. They act the same as the other number variables, so you can add, subtract, multiply, divide, and modulo divide to your heart's content. If you have any questions, or have any additional 64-bit integer information that should be included here, please, comment. :)