The insert function int the arrayList is not working...d[count] = v is giving garbage.I am unable to find the problem.Can anybody please help.
class ArrayList
{
private:
int count;
int *d;
public:
ArrayList(int size=2)
{
d=new int[size];
count = 0;
}
void insert (int r)
{
d[count] = r;
count++;
}
};
int main()
{
ArrayList col;
col.insert(5);
col.display();
return 0;
}