How to unify named and anonymous scripts?

Could this variant be maybe helpful for your use case?

merged.C:

{
    int a = 123;

    a = a+5;
}

void merged()
{
    cout << a << endl;
}

(The unnamed scope braces are actually unnecessary, you can just leave them out)

1 Like