|
led mike,
I don't think I did a good job describing the problem. It should have been how to handle a dynamic array argument in c#.
From readings that I have done, I do not think it's possible. I think I have to use Arraylist.
|
|
|
|
|
You would be better off using a generic collection rather than an arraylist
only two letters away from being an asset
|
|
|
|
|
I am going to look into collection but can you educate a bit about the differences between the two?
Thanks
|
|
|
|
|
Given your example using an ArrayList you would incur a boxing/unboxing penalty everytime to stored or accessed the values since ArrayList uses object. Using a generic collection, say List<double> you would not have this issue, with the additional benefit of being typesafe.
only two letters away from being an asset
|
|
|
|
|
Greetings Good People,
What is a good book I can use to learn about the .NET Framework Class Library for C#?
Thanks,
BP
|
|
|
|
|
|
Framework 3.0 exist but you advice 1.1
|
|
|
|
|
I do not advice anything.
I just recommended a good source for learning.
SkyWalker
|
|
|
|
|
The best book that I can think of that is primarily for C# and is the first place I look for all my questions in the language is: Sams Teach Yourself Visual Studio 2003 in 21 Days (I am sure their is a 2005 version). The book covers both C# and Visual Basic and gives you a complete outline of the features of various class libraries. An excellent book.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Which C#/.NET Obfuscator is best? Price and feature wise? I wise looking at the professional edition of dotfuscator but the price for the professional one is just silly. Any recommendations would be welcome.
|
|
|
|
|
|
ok. thanks. ive had a good look at that document before. What Obfuscators do you guys use?
|
|
|
|
|
One of them
SkyWalker
|
|
|
|
|
here is a good thread about them and a few naems and prices if you read the entire thread.
http://www.truevision3d.com/phpBB2/viewtopic.php?t=14340
|
|
|
|
|
I want that every button click
I will have a new object like:
class x = new class();
(the next time I will click on the button i will have another object named y or something else)
thanks
|
|
|
|
|
And what the question might be?
SkyWalker
|
|
|
|
|
You may use an array to store on increasing indexed items the newly created objects.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I tried to use arraylist
but again the first element in the array
is the same name as the second and so on
can you give me example of how to call the object from the arrylist?
thanks
|
|
|
|
|
Can you please post the relevant piece of code, pointing out what's going wrong?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I wrote:
Class p = new Class();
ArrayList a = new ArrayList();
a.Add(p);
now I want to call function of on eof the objects
in the array
how I call it?
a[0].?
|
|
|
|
|
groundzero111 wrote: how I call it?
It is quite straighforward, you have only to remember that, since the ArrayList operator [] returns an Object , then you have to cast it to the proper type, for instance (assuming that MyClass has a method Version() returning a string ):
MyClass p = new MyClass();
ArrayList a = new ArrayList();
a.Add(p);
string sVersion =((MyClass)a[0]).Version();
MessageBox.Show(sVersion);
hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
but if I want to call method Version for every object
in the array?
I tried to do :
a[0].Version;
but it's not working.why?
|
|
|
|
|
How does versioning work and how do I set up my project to have a version no.?
|
|
|
|
|
The most famous project to help u with versioning is CVS, well am using it with Mono-Develop over Linux i don't if there is a version for Windows, but i guess there is a version for Windows
Pray for people Die everyday in Iraq
|
|
|
|
|
I believe he was asking versioning the assemblies in a project not version CONTROL
only two letters away from being an asset
|
|
|
|