c++ – How to create integer poiner in an array of raw data?

In case Config is really meant to be a buffer for raw data, where you ensure that the data is always filled and interpreted in the same way, then and only then is this approach independent of the endianess and sign of char.
With that approach you can use Config like a C-memory, allocated via malloc.

Take good care about the data type sizes and indexes (the pointer to int16_t acesses the content from two char)!
This is more a potential dangerous C implementation than safe C++

All you need to do is to interprete the pointer to the internal char array as a pointer to an int16_t array.

std::vector Config(0x0F, 20);  // 20 Bytes filled with some dummy values
int16_t* pRaw = (int16_t*)&Config[18];
int16_t Config_Number = *pRaw;

or in short

std::vector Config(0xFF, 20);  // 20 Bytes filled with some dummy values
int16_t Config_Number = *((int16_t*)&Config[18]);

Read more here: Source link