Starting with a more advanced C++ course, we have to implement an own Matrix, which is typical for first exercises. We received a skeleton to work on and i have got only one question left. The type of the access and size variables.

Here a simple constructor for 1D Matrix, with some Checking of the size.

```
Array::Array( int xSize )                                                                                     
{                   
    CHECK_MSG(xSize > 0, "Array size too small");
    array_ = new real[xSize];
    size_ = xSize;  
}

```

Does it make sense to use a size\_t or unsigned int instead of an int? After reading the definition of size\_t i would tend to use it instead. However in many codes i see just ints everywhere. Is it a java-like coding style? Has size\_t any disadvantages i missed?

Edit:

The main question relates to the coding style. I fully understand the difference of size\_t and (unsigned) int, as it was already explained here:[unsigned-int-vs-size-t](https://stackoverflow.com/questions/131803/unsigned-int-vs-size-t)