tailieunhanh - Programming in Objective-C 2.0 edition phần 10

bạn phải chăm sóc mà chương trình của bạn không tiếp tục tiêu thụ tài nguyên bộ nhớ hơn vì nó chạy. Trong trường hợp này, nó sẽ trở thành trách nhiệm của bạn để quản lý thông minh các nguồn lực và miễn phí cho họ khi họ không còn có nghĩa là giải phóng tài nguyên trong quá trình thực hiện của chương trình | 522 Appendix B Objective-C Language Summary declares myFract to be an object of type Fraction or more explicitly myFract is used to hold a pointer to the object s data structure after an instance of the object is created and assigned to the variable. Pointers that point to elements in an array are declared to point to the type of element contained in the array. For example the previous declaration of ip would also be used to declare a pointer into an array of integers. More advanced forms of pointer declarations are also permitted. For example the declaration char tp 100 declares tp to be an array of 100 character pointers and the declaration struct entry fnPtr int declares fnPtr to be a pointer to a function that returns an entry structure and takes a single int argument. A pointer can be tested to see whether it s null by comparing it against a constant expression whose value is implementation can choose to internally represent a null pointer with a value other than 0. However a comparison between such an internally represented null pointer and a constant value of 0 must prove equal. The manner in which pointers are converted to integers and integers are converted to pointers is machine-dependent as is the size of the integer required to hold a pointer. The type pointer to void is the generic pointer language guarantees that a pointer of any type can be assigned to a void pointer and back again without changing its value. The type id is a generic object pointer. Any object from any class can be assigned to an id variable and vice versa. Other than these two special cases assignment of different pointer types is not permitted and typically results in a warning message from the compiler if attempted. Enumerated Data Types General Format enum name enum_1 enum_2 . variableList The enumerated type name is defined with enumeration values enum_1 enum_2 . each of which is an identifier or an identifier followed by an equals sign and a constant .

TỪ KHÓA LIÊN QUAN