property and array

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2009
Posts: 9
Reputation: cljlxwater is an unknown quantity at this point 
Solved Threads: 0
cljlxwater cljlxwater is offline Offline
Newbie Poster

property and array

 
0
  #1
Mar 6th, 2009
if i define a array, for example private int[] lendMoney = new int[10]; do i can use a use property to match this private array? thank you
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: property and array

 
0
  #2
Mar 6th, 2009
of course, the same as you would any other property

  1. public int[] LendMoney
  2. {
  3. get{return lendMoney;}
  4. set{lendMoney = value;}
  5. }

Might want to use an arraylist instead, if its not a fixed length
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,039
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: property and array

 
0
  #3
Mar 6th, 2009
Originally Posted by dickersonka View Post
Might want to use an arraylist instead, if its not a fixed length
No, you'd want to use a List<int> . If you wanted it to be variable length. Which for most people in most situations is wrong.
Last edited by Rashakil Fol; Mar 6th, 2009 at 11:43 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC