Hi

wait (unsigned int delay)
wait (unsinged long delay)


Whats the difference between the two, i forgot to test this out, basically its part of a delay for seven segemtn display which just cycles through numbers, what would be the difference between the two?

thanks for nay help

The functionality is the same. The only difference is that the maximum delay possible by the second function is greate than the maximum delay possible by the first function. This is because the storable range of long is larger than int.

This is because the storable range of long is larger than int.

Actually this is not true on most systems.

unsigned long, 4 bytes
0 to 4,294,967,295

unsigned int, (also) 4 bytes
0 to 4,294,967,295

Even in 64bit programming (on Windows with Visual Studio) they are the same size and hold the same range of values.

Given that the OP referred to a "7 segment display", one assumes that this is some small scale embedded platform with either an 8 or 16 bit processor, and not much in the way of API calls.

So sizes of data types can only be inferred, not quoted.

If the OP wants a better answer, we need more detail.

Size of integer types is dependent on the architecture being supported:

There are four signed integer types: “signed char”, “short int”, “int”, and “long int.” In this
list, each type provides at least as much storage as those preceding it in the list. Plain ints have the natural size suggested by the architecture of the execution environment the other signed integer types are provided to meet special needs.

This article has been dead for over six months. Start a new discussion instead.