Answer the question
In order to leave comments, you need to log in
Objects in objective c. How to determine?
Objects are instances of a class, in order to use the class code, we need to create an object.
@interface Person : NSObject {
NSString *_name;
NSInteger _age;
}
double *_areaTriangle; // ?
Answer the question
In order to leave comments, you need to log in
The "star sign" is placed where you declare not a variable, but a pointer to it. Accordingly, what you want - then declare it as pointers, if you need it.
Specifically, in the example with a triangle, I would not make any pointers. And the area is not a variable, but a method. The class is a triangle, with parameters - sides and a method - "calculate area", "calculate perimeter", etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question