hello everyone,
in C++ you have the option of not defining the number of elements you want in an array like this .
Code:
int a[]={1,2,3,4,5,6,7};
i want to mimic the arrays using classes, i want to mimic this very functionality for example:
Code:
class Array
{
............
.........
.....
};
void main()
{
Array a(1,2,3,4,5,6,7);
}
MY QUESTION IS THIS IS IT POSSIBLE TO GIVE AN UNDEFINED NUMBER OF ARGUMENTS IN A CONSTRUCTOR SO I CAN MIMIC THE ARRAY STYLE OF INITIALIZATION.
if you still dont understand the question let me be more thorough .
Code:
int a[]={1,2,3,4,5,6}; // this is possible in c++. Remember the
// number of the inputs is undefined. It
// depends on the user.
Array a(1,2,3,4,5,6,6,7);// is the same possible can i use no matter
// how many arguments i want?