943,954 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 2129
  • C# RSS
Mar 6th, 2009
0

property and array

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cljlxwater is offline Offline
9 posts
since Feb 2009
Mar 6th, 2009
0

Re: property and array

of course, the same as you would any other property

C# Syntax (Toggle Plain Text)
  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
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Mar 6th, 2009
1

Re: property and array

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.
Team Colleague
Reputation Points: 1135
Solved Threads: 172
Super Senior Demiposter
Rashakil Fol is online now Online
2,479 posts
since Jun 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

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: Want to execute a command on all files recursively
Next Thread in C# Forum Timeline: databind checkbox in window application





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


Follow us on Twitter


© 2011 DaniWeb® LLC