Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: print vector of vector c++ 
Cpp :: for loop with array c++ 
Cpp :: Rick Astley - Never Gonna Give You Up 
Cpp :: struct and array in c++ 
Cpp :: define unicode c++ 
Cpp :: c++ length of char array 
Cpp :: number of characters in c++ files 
Cpp :: c++ console color 
Cpp :: how to make copy constructor in c++ 
Cpp :: c++ random number within range 
Cpp :: how to remove an element from a vector by value c++ 
Cpp :: segmented sieve of Eratosthenes in cpp 
Cpp :: how to scan array in c++ 
Cpp :: cpp std list example 
Cpp :: strlen in c++ 
Cpp :: the code execution cannot proceed because glew32.dll was not found 
Cpp :: comparator for priority queue c++ 
Cpp :: delete from front in vector c++ 
Cpp :: check if whole string is uppercase 
Cpp :: C++ Structures (struct) 
Cpp :: powershell get uptime remote computer 
Cpp :: c++ lambda 
Cpp :: c++ casting 
Cpp :: 3d projection onto 2d plane algorithm 
Cpp :: how to compile opencv c++ in ubuntu 
Cpp :: c++ namespace 
Cpp :: how to use toString method in C++ 
Cpp :: how to turn int into string c++ 
Cpp :: length of array c++ 
Cpp :: how to make a comment in c++ 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =