I have a struct with 2 std::vectors as given below. I want to initialize the vector with 2048 elements having initial value 0.0.
struct PixelMaps
{
vector<double> pixelMapX;
vector<double> pixelMapY;
};
I tried the following code. This creates the vector of 2 elements only. How can I initialize the structure with 2048 elements in a single statement with initialization list?
PixelMaps test{ {2048,0.0}, {2048, 0.0} };