glades
glades

Reputation: 4789

Fastest way to transform C multilevel designated initializer list to C++?

I have a designated initializer list with multiple levels from C-Code like the following and I want to transform the whole codebase to C++.

C-Code:

wifi_config_t wifi_config = {
    .sta = {
        .ssid = EXAMPLE_ESP_WIFI_SSID,
        .password = EXAMPLE_ESP_WIFI_PASS,
        .threshold.authmode = WIFI_AUTH_WPA2_PSK,
        .pmf_cfg = {
            .capable = true,
            .required = false
        },
    },
};

How do I transform it to C++ so that the compiler understands it? I have a lot of setups like that so I would appreciate a simple and fast solution.

Upvotes: 0

Views: 66

Answers (0)

Related Questions