943,767 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1574
  • C++ RSS
Jan 25th, 2008
0

unsigned int delay and unsinged long dealy

Expand Post »
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
Last edited by Villanmac; Jan 25th, 2008 at 6:04 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Villanmac is offline Offline
13 posts
since Nov 2007
Jan 25th, 2008
0

Re: unsigned int delay and unsinged long dealy

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.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Jan 25th, 2008
0

Re: unsigned int delay and unsinged long dealy

Click to Expand / Collapse  Quote originally posted by WolfPack ...
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.
Reputation Points: 36
Solved Threads: 0
Light Poster
Passmark is offline Offline
32 posts
since Jan 2008
Jan 25th, 2008
0

Re: unsigned int delay and unsinged long dealy

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.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Jan 25th, 2008
0

Re: unsigned int delay and unsinged long dealy

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

Quote ...
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.
Reputation Points: 1268
Solved Threads: 228
Posting Virtuoso
vmanes is offline Offline
1,895 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Dev C++: Remove Spaces
Next Thread in C++ Forum Timeline: Help on a School Project





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC