iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Accept the size of the Account array from the user at run time and dynamically allocate the array. If not that, then use vectors.
Account* accArray = new Account[size_from_user];
for(int i = 0; i < size_from_user; ++i)
{
//code
}
delete[] accArray;
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
Read the sample snippet I posted in my previous post.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
An array of objects should be handled in a similar fashion to an array of ints or strings for that matter.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
An array of objects should be handled in a similar fashion to an array of ints or strings for that matter.
this is possible only if there is an accessible default constructor.
vijayan121
Posting Virtuoso
1,606 posts since Dec 2006
Reputation Points: 1,159
Solved Threads: 287