unsigned int delay and unsinged long dealy

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 13
Reputation: Villanmac is an unknown quantity at this point 
Solved Threads: 0
Villanmac Villanmac is offline Offline
Newbie Poster

unsigned int delay and unsinged long dealy

 
0
  #1
Jan 25th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: unsigned int delay and unsinged long dealy

 
0
  #2
Jan 25th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 31
Reputation: Passmark is an unknown quantity at this point 
Solved Threads: 0
Passmark's Avatar
Passmark Passmark is offline Offline
Light Poster

Re: unsigned int delay and unsinged long dealy

 
0
  #3
Jan 25th, 2008
Originally Posted by WolfPack View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: unsigned int delay and unsinged long dealy

 
0
  #4
Jan 25th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1,675
Reputation: vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold 
Solved Threads: 193
vmanes's Avatar
vmanes vmanes is offline Offline
Posting Virtuoso

Re: unsigned int delay and unsinged long dealy

 
0
  #5
Jan 25th, 2008
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.
"We Americans got so tired of being thought of as dumb by the rest of the world that we went to the polls last November and removed all doubt."
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC