I have to write a program for my c++ course, and one of the requirements is to allow the user to enter a number of feet, and the program should output the WHOLE number of miles in that number of feet, and then the number of miles left over. This is very simply to do, simply doing integer division, and then doing a feet\%5280 (modulus) operation to get the remainder. However, my instructor decided to add a requirement that the number that can be entered by the user can be as long as 13-14 digits. So, what type of variable do I use?
It needs to be integral to use the \% operator, so no floats or doubles. I did mess around some, and I found that a "double long" was a valid type, which was basically twice as long as a "long" (4 bytes on the school's systems, so the double long was 8 bytes). However, this data type doesn't seem to work with the modulus operator. I am at a loss of what type to use. Any suggestions? Edit: BTW, we are using Codewarrior 4 or something on WinNT
This message has been edited by a.out on September 27, 2001 at 06:44 PM