Newsgroups: comp.lang.c++
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!sarah!bingnews!bingsuns.cc.binghamton.edu!consp06
From: consp06@bingsuns.cc.binghamton.edu (Robert Konigsberg)
Subject: Use of Ellipsis on c++
Message-ID: <1991Apr18.203147.19510@bingvaxu.cc.binghamton.edu>
Sender: usenet@bingvaxu.cc.binghamton.edu (Mr UseNet)
Nntp-Posting-Host: bingsunp.pod.binghamton.edu
Reply-To: consp06@bingsuns.cc.binghamton.edu (Robert Konigsberg)
Organization: SUNY Binghamton
Date: Thu, 18 Apr 1991 20:31:47 GMT

I'm writing my first c++ Class - Matrices (Ooooohh)

The Constructor is defined as follows:

void Matrix(unsigned xv=1, yv=1, ...) {Alloc(xv,yv); SetZero();
                                       Values(...);};

See?  It initializes the size in Alloc.  It sets all the values to
zero in SetZero, and then takes the values from ... in inserts them
into the matrix.  Granted, this makes SetZero redundant, but it
doesn't if there is nothing for the ellipsis.

Now, if, later on, I do the following:

Matrix a(2,2,1,2,3,4),b,c;

It defines a as
[ 0 0 ]
[ 0 0 ]

b and c as 
[ 0 ]

a should be
[ 1 2 ]
[ 3 4 ]

Why isn't it?  I know that if I just rewrite my code to take care of
the variable arguments directly within Matrix, I'll have no problem,
but if I do that, then it'll waste code.  I still need Values if I
want to redefine the values.  Why is this happening?

			-Rob Konigsberg
