c 2b 2b 20 struct initialization

Solutions on MaxInterview for c 2b 2b 20 struct initialization by the best coders in the world

showing results for - "c 2b 2b 20 struct initialization"
Mika
23 Jun 2016
1#include <iostream>
2#include <filesystem>
3
4struct hello_world {
5    const char* hello;
6    const char* world;
7};
8
9int main () 
10{
11    hello_world hw = {
12        .hello = "hello, ",
13        .world = "world!"
14    };
15
16    std::cout << hw.hello << hw.world << std::endl;
17    return 0;
18}