Question: I am pretty new to mysql. I have set of csv files which I want to insert into different tables. I have fixed 100 columns for all the files. But, some files contain values only upto 50 column. So I want to insert zero value for all the other columns. Can someone please tell me how to do that.

Answer: 
You can use the ternary or conditional operator. The basic form is:

```
condition ? valueIfTrue : valueIfFalse

```

Example:  

```
const char* x = (SomeFunction() == 0) ? "is null" : "is not null";

```

When `SomeFunction()` returns 0, `x` is initialised with "`is null`", otherwise
with "`is not null`".
You say you are modifying an existing old project. In that case it makes sense to keep changes minimal.

However, you can't define the size of a static array at run time. If you want, you can keep the array as it currently is and make sure you don't use the 4th element when data->nDataVar() != 1.

Then:

```
const size_t dataSize = data->primType().getTypeSize() * dimsOut[0] * dimsOut[1] * dimsOut[2] * (data->nDataVar() != 1 ? 1 : dimsOut[3]);

```

It's worth mentioning the dimsOut array seems completely unnecessary to calculate the value of dataSize, but who knows what else your code is doing with it. If it is only used inside a single function/method then you could easily replace it with something else, such as std::vector.