This will go faster if I show you what I want to do.

class matrix {
public:
  double *x;
  int clms, rows;

  matrix(int unknowns)
  {
    rows = unknowns;
    clms = unknowns + 1;
    x = new double[rows * clms];
  }

  matrix operator = (double a[]) const
  {
    matrix tmp(rows);
    
    tmp.x = a;
    return tmp;
  }     
};



int main()
{
  matrix m(3) = { 1, 2, 3.2, 4,
                  3, .2, 1, 4,
                  5, -2, .68, 5};
}

basically I want to be able to initialize and fill up m.x with the array that I passed it.
This is basically what the string class lets you do, for example:
string s = { 'h', 'e', 'l', 'l', 'o' , '\0' };
or as normal people do:
string s = "hello";

Anyone know how to do this?

Yes but I'm not going to pass another matrix class object to the = operator, instead I want to initialize the member x array as I would a regular array, like this:
matrix m(3) = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 ,12};

and not do this:

matrix m(3), m2(3);
for (int i = 0; i < 12; i++)
m.x = i + 1;
m2 = m;

This article has been dead for over six months. Start a new discussion instead.