C++ return array from function I would like to implement machine learning algorithm in C++ without using any C++ machine learning library. So I'm writing this initializer function for generating zero matrices but can't figure out how can I accomplish this. I'm actually trying to write C++ code for simple logistics regression for now.

float * intializer_zero(int dimension){
    // z = wx + b. 

float b = 0;
float w[dimension]= { };
return w,b;
}


It's throwing error "cannot convert 'float' to 'float' in return."
How can I write this initializer function in C++?
You can do something like that for matrix

mat = new float*[rows];

for (ushort i = 0; i &lt; rows; i++) {
    mat[i] = new float[cols](); //init 0


}