get a struct member pointer

Jeffry Nox jfnoxville at eastgnet.com
Sun Feb 15 20:31:49 PST 2009


struct A {
	uint id=0;
	char[] name;
}

struct B {
	uint id=0;
	char[] title;
}

void lookup(T)(T[] s, ***)
{
  char[] txt = s[0].***;
}

as illustrated above, how can i get struct object property info as in *** so i can manipulate it inside the function lookup above? in function lookup, i didnt know what is the variable name for the char[], so *** pass in the 2nd parameter, question is how to pass that member info or pointer so that it works on different struct declarations?



More information about the Digitalmars-d-learn mailing list