Answers for "initialize struct c"

1

c++ 20 struct initialization

#include <iostream>
#include <filesystem>

struct hello_world {
    const char* hello;
    const char* world;
};

int main () 
{
    hello_world hw = {
        .hello = "hello, ",
        .world = "world!"
    };

    std::cout << hw.hello << hw.world << std::endl;
    return 0;
}
Posted by: Guest on August-17-2020
0

struct initialization

struct Person
{
    char name[50];
    int citNo;
    float salary;
} person1, person2, p[20];
Posted by: Guest on June-17-2021

Code answers related to "Objective-C"

Browse Popular Code Answers by Language