Objective C LValue required as unary '&' operand
- by Bob
Hello! In my code, I get this error when I try to get a pointer to my class property.
(I wrote a small *.OBJ file translator in Python, discarding the normals)
CODE:
//line: line of text
const char *str = [line UTF8String];
Point3D *p1, *p2, *p3;
p1 = [Point3D makeX:0 Y:0 Z:0];
p2 = [Point3D makeX:0 Y:0 Z:0];
p3 = [Point3D makeX:0 Y:0 Z:0];
sscanf(str, "t %f,%f,%f %f,%f,%f %f,%f,%f",(&[p1 x]),&([p1 y]),&([p1 z]),&([p2 x]),&([p2 y]),&([p2 z]),&([p3 x]),&([p3 y]),&([p3 z]));
Triangle3D *tri = [Triangle3D make:p1 p2:p2 p3:p3];