For example:
List<Projects> projectList = new List<Projects>
{
new Project
{
id = 100500,
Subprojects = new List<Subproject>
{
new Subproject { Project = "**Need to pass pointer on the project**" },
}
}
}
How it possible to pass this pointer?
It’s a question just about syntax, I clearly understand that it possible to do that another way.
You cannot do it in a single statement: the pointer (actually, the reference) that you would like to be assigned to
Projectis not allocated at the time you want to assign it. You need to use an intermediate variable – for example, like this: