1

I am struggling to understand the meaning of "get_long_long" in credit.c(more comfortable),pset1. I will be highly obliged if I am explained the meaning and usage of the same. Thankyou.

3

get_long_long() is a function just like get_int() or get_long(), but it will return a long long int in stead of an int or long int.

A long long int is at least 64 bits, whereas a long int might be as short as 32 bits.

Now remember that 2^10 = 1024, so approximately 1,000. Therefore it is easy to see that 2^32 = 2^2 * 2^10 * 2^10 * 2^10, so with 32 bits the biggest possible integer is just slightly over 4 * 1,000 * 1,000 * 1,000 = 4,000,000,000. (In fact it's only half as big, becaue a long int can also be negative)

In other words: Even a 10-digit integer could be too long to fit in a long int.

Now remember that some credit card numbers have 16 digits ...


Finally, to quote Cliff B:

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .