RSS Forums RSS
Please support our C++ advertiser: Programming Forums

C and C++ Timesaving Tips

Join Date: Apr 2004
Posts: 3,766
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 17
Solved Threads: 147
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: C and C++ Timesaving Tips

  #26  
Sep 15th, 2005
A size_t is an unsigned integral type which is the result of the sizeof operator. The two are designed to go together. To me it's the type most suited to indexing an array (you don't need negative indexes, do you?).

Sure you could use an int and it will be correct 99.999% of the time -- I was just going for 100%. Plus, with an array of ints, I find it easier to see the index from the data if they're not just slopped together.
High Plains Blogger #plains #lounge ## I, for one, welcome our new socialist overlords.
"Capitalism is the unequal distribution of wealth. Socialism is the equal distribution of poverty."
 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:00 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC