Q: C ++, use a "typedef" of struct in a large "typedef" of struct For my program I need to do something like this:
myObject.objectFunction(Process.MARKING);

To do this I thought of doing it like this:
file header:
typedef struct _process
{
   string process_name;
   string party_involved;
} process;

typedef struct _PROCESS
{
    process MARKING;
    MARKING.process_name = "...";
    MARKING.party_involved = "...";

    process COLORING;
    COLORING.process_name = "...";
    COLORING.party_involved = "...";
    ...
} PROCESS;

But I can't compile or correct the error.
I know I can use macros attached to namespaces, but I don't like having to use "::", and I also know that maybe this is not the best way to program.
I forgot to add that I would also like to make the elements of the struct constant larger i.e. not editable after compile and I also need to use the typedef of the smaller structure (process) outside the header file.
Can you tell me where I'm wrong, and/or a better way to do what I want to do?

A: You actually don't need to typedef your structs at all - they are type defined automatically. You do however have a problem with initializing. In C++20, you can use designated initializers:
#include <string>

struct process {
    std::string process_name;
    std::string party_involved;
};

struct PROCESS {
    process MARKING{
        .process_name = "...",
        .party_involved = "..."
    };
    // same for COLORING
};

And before C++20:
struct process {
    std::string process_name;
    std::string party_involved;
};

struct PROCESS {
    process MARKING{
        "...",
        "..."
    };
    // ...
};


If you don't want any other object to be allowed to make changes to these member variables, make them private and provide const& accessors:
struct PROCESS {
    const process& getMarking() const { return MARKING; }

private:
    process MARKING{
        "...",
        "..."
    };
};

Now, myObject.objectFunction(Process.getMarking()); can't change it and must either take the object by value or by const&:
struct Object{
    void objectFunction(const process& MARKING) {

    }
};

