Hi ,
Here I am new user to C#, my problem is I have to use dynamic Array of
objects. But I heard C# don't support ptrs (using managed code C#
support).
In short i initialized objects of 1000 and I am using is upto 10 or
less. Because of that I find 990 reset of them as un initialized
objects, when I extract the information from the Object it will throw
an exception also and I feel unnecessarily I am wasting of memory.
So I need dynamic allocation of the objects so can any body give me
some samples or suggestion then it will be very help full
Brief discussion of my problem I declare array of Object in 1ST Step
and Initialized in 2nd Step. What I am doing in My 3rd Step I don't
know.
When I am parsing array of Objects I find so many un initialized
objects( as per my step2 means 1000). but actually I storing the data
in object RulesProperties is very less in step3 i.e m_icount.
public class RuleXMLParser
{
Step1: RuleXMLParser [] RulesProperties;
public RuleXMLParser()
{
//Do some initialization
}
public void InitializeRules(XmlNodeList RuleNodes)
{
Step2: RulesProperties = new RuleXMLParser[1000];
for(int i = 1; i < RuleNodes.Count; i++)
{
for(int j = i+1; j< RuleNodes.Count -1; j++)
{
CompareRuleNodes(RuleNodes[i],RuleNodes[j]); }
}
}
}
private void CompareRuleNodes(XmlNode RuleNodes1,XmlNode RuleNodes2)
{
Step3: RulesProperties[m_icount] = new RuleXMLParser();
}