GPWiki.org
GPWiki.org
It is currently Wed May 22, 2013 5:33 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Aug 19, 2012 3:41 am 
Ankle Nibbler
User avatar

Joined: Tue Dec 20, 2005 12:28 am
Posts: 140
How To Modify An Element in the Dictionary Class?
=======================================

C# has this cool Dictionary class that you can use like a Hash Table. Is there a way of changing the value of an indexed element without resorting to removing it like this?

Code:
               int value = runningcount[city];
               runningcount.Remove(city);
               runningcount.Add(city, ++value);


Top
 Profile  
 
PostPosted: Sun Aug 19, 2012 9:35 am 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3735
Location: South Africa
Why is this exact same question asked on umpteen different sites?

https://www.google.com/search?q=%22How%20To%20Modify%20An%20Element%20in%20the%20Dictionary%20Class%22

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
PostPosted: Mon Aug 20, 2012 2:36 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6716
Location: Oxford, Englandshire
LOL, Busted!

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
PostPosted: Fri Sep 14, 2012 11:53 pm 
411 Operator

Joined: Tue Feb 21, 2006 12:32 am
Posts: 481
Location: California, USA
Haxed!? :rofl

_________________
The only difference between genius and psychosis is that society accepts the genius.


Top
 Profile  
 
PostPosted: Tue Sep 18, 2012 5:26 pm 
Ankle Nibbler
User avatar

Joined: Tue Dec 20, 2005 12:28 am
Posts: 140
IGTHORN wrote:


So what? Getting multiple opinions is a good thing.


Top
 Profile  
 
PostPosted: Tue Sep 18, 2012 5:26 pm 
Ankle Nibbler
User avatar

Joined: Tue Dec 20, 2005 12:28 am
Posts: 140
Codehead wrote:
LOL, Busted!


Nope.

Not Busted, since I did nothing wrong.


Top
 Profile  
 
PostPosted: Tue Sep 18, 2012 9:58 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6716
Location: Oxford, Englandshire
Cross Posting is frowned upon in most forums. That level of duplication is bordering on spamming.

Questions are fine, we all have them, but treating multiple forums like some sort of magic box for answering queries isn't really entering into the spirit of things.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group