user33209: I'm going through problem in Arduino code. I have three Arrays and want to convert them into a matrix. I have tried hard but couldn't solve issue. 
float lb1[24]={1580,480,1580,1580,580,1950,3125,1625,250,500,250,600,500,1450,1480,630,530,1655,1475,3225,3300,1450,280,1730};
float lb2[24]={1450,600,1700,600,3080,3005,1655,500,250,500,600,350,250,1700,1700,600,1625,250,1405,3255,4455,1800,500,1450};
float lb3[24]={500,500,600,600,380.3005,3155,530,400,400,600,350,250,250,500,500,250,1655,1655,3155,2130,250,150,250};
float Loadbase,Loadshift;

void setup() {
    for (int i=0;i<24;i++){
        Loadbase={lb1[i],lb2[i],lb3[i]}; 
    }
}

void main() {
}


user23841: Two dimensional arrays in C++ (directly):
float matrix[3][24] = {
    {1580,480,1580,1580,580,1950,3125,1625,250,500,250,600,500,1450,1480,630,530,1655,1475,3225,3300,1450,280,1730},
    {1450,600,1700,600,3080,3005,1655,500,250,500,600,350,250,1700,1700,600,1625,250,1405,3255,4455,1800,500,1450},
    {500,500,600,600, 380.3005 ,3155,530,400,400,600,350,250,250,500,500,250,1655,1655,3155,2130,250,150,250}
};

Two dimensional array indirectly (array of pointers):
float lb1[24]={1580,480,1580,1580,580,1950,3125,1625,250,500,250,600,500,1450,1480,630,530,1655,1475,3225,3300,1450,280,1730};
float lb2[24]={1450,600,1700,600,3080,3005,1655,500,250,500,600,350,250,1700,1700,600,1625,250,1405,3255,4455,1800,500,1450};
float lb3[24]={500,500,600,600,380.3005,3155,530,400,400,600,350,250,250,500,500,250,1655,1655,3155,2130,250,150,250};
float * matrix[3] = {lb1, lb2, lb3};

If you want two dimensional array with copies of lb1/lb2/lb3:
float matrix[3][24];
for (int i = 0; i < 24; ++i) {
    matrix[0][i] = lb1[i];
    matrix[1][i] = lb2[i];
    matrix[2][i] = lb3[i];
}

Btw: you were saying something about "mistakes" if I split definition on more lines, but guess what:
float lb3[24]={500,500,600,600,  380.3005  ,3155. This is a valid float number, but you have only 23 items then.
If you use at least space as a number separator, it can't be even compiled:
float lb3[24] = { 500, 500, 600, 600, 380. 3005, 3155, 530, 400,  400, 600, 350, 250, 250, 500, 500, 250, 1655, 1655, 3155, 2130, 250, 150, 250};


33209: <p>I'm going through problem in Arduino code. I have three Arrays and want to convert them into a matrix. I have tried hard but couldn't solve issue. </p>

<pre><code>float lb1[24]={1580,480,1580,1580,580,1950,3125,1625,250,500,250,600,500,1450,1480,630,530,1655,1475,3225,3300,1450,280,1730};
float lb2[24]={1450,600,1700,600,3080,3005,1655,500,250,500,600,350,250,1700,1700,600,1625,250,1405,3255,4455,1800,500,1450};
float lb3[24]={500,500,600,600,380.3005,3155,530,400,400,600,350,250,250,500,500,250,1655,1655,3155,2130,250,150,250};
float Loadbase,Loadshift;

void setup() {
    for (int i=0;i&lt;24;i++){
        Loadbase={lb1[i],lb2[i],lb3[i]}; 
    }
}

void main() {
}
</code></pre>
 23841: <p>Two dimensional arrays in C++ (directly):</p>

<pre><code>float matrix[3][24] = {
    {1580,480,1580,1580,580,1950,3125,1625,250,500,250,600,500,1450,1480,630,530,1655,1475,3225,3300,1450,280,1730},
    {1450,600,1700,600,3080,3005,1655,500,250,500,600,350,250,1700,1700,600,1625,250,1405,3255,4455,1800,500,1450},
    {500,500,600,600, 380.3005 ,3155,530,400,400,600,350,250,250,500,500,250,1655,1655,3155,2130,250,150,250}
};
</code></pre>

<p>Two dimensional array indirectly (array of pointers):</p>

<pre><code>float lb1[24]={1580,480,1580,1580,580,1950,3125,1625,250,500,250,600,500,1450,1480,630,530,1655,1475,3225,3300,1450,280,1730};
float lb2[24]={1450,600,1700,600,3080,3005,1655,500,250,500,600,350,250,1700,1700,600,1625,250,1405,3255,4455,1800,500,1450};
float lb3[24]={500,500,600,600,380.3005,3155,530,400,400,600,350,250,250,500,500,250,1655,1655,3155,2130,250,150,250};
float * matrix[3] = {lb1, lb2, lb3};
</code></pre>

<p>If you want two dimensional array with copies of lb1/lb2/lb3:</p>

<pre><code>float matrix[3][24];
for (int i = 0; i &lt; 24; ++i) {
    matrix[0][i] = lb1[i];
    matrix[1][i] = lb2[i];
    matrix[2][i] = lb3[i];
}
</code></pre>

<p>Btw: you were saying something about "mistakes" if I split definition on more lines, but guess what:
<code>float lb3[24]={500,500,600,600,  380.3005  ,3155</code>. This is a valid float number, but you have only 23 items then.</p>

<p>If you use at least space as a number separator, it can't be even compiled:</p>

<pre><code>float lb3[24] = { 500, 500, 600, 600, 380. 3005, 3155, 530, 400,  400, 600, 350, 250, 250, 500, 500, 250, 1655, 1655, 3155, 2130, 250, 150, 250};
</code></pre>
