91. char *GetMemory( void ) {
GetMemory(); printf( str );
char p[] = "hello world";
return p;
p[]
91. char *GetMemory( void ) { char p[] = "hello world";
printf( str ); }
char p[] = "hello world";
char p[] = "hello world"; return p; } void Test( void ) {char *str = NULL;
void Test( void ) {char *str = NULL;
void Test( void ) {char *str = NULL; str =
92. void GetMemory(char **p, int num ) {*p = (char *) malloc( num );}
GetMemory( &str, 100 );
GetMemory
*p = (char *) malloc( num );
if ( *p == NULL )
{
...//
92. void GetMemory(char **p, int num ) {*p = (char *) malloc( num );}
GetMemory( &str, 100 ); strcpy(str, "hello" );printf( str );}
GetMemory
*p = (char *) malloc( num );
92. void GetMemory(char **p, int num ) {*p = (char *) malloc( num );}
strcpy(str, "hello" );printf( str );}
GetMemory
92. void GetMemory(char **p, int num ) {*p = (char *) malloc( num );} void Test(void) {char *str = NULL;
GetMemory
void Test(void) {char *str = NULL;
}
93. void Test( void ) {char *str = (char *) malloc( 100 );
char *str = (char *) malloc(100);
free(str)
94. BOOL
BOOL
93. void Test( void ) {char *str = (char *) malloc( 100 );
char *str = (char *) malloc(100);
free(str)str
BOOLintfloat―
BOOLif(!var)
93. void Test( void ) {char *str = (char *) malloc( 100 ); strcpy( str, "hello" );
char *str = (char *) malloc(100);
―ǁstr = NULL;
― if
strcpy( str, "hello" ); free( str ); ... //
str = NULL;
var
BOOL
int if(var==0)
float
const float EPSINON = 0.00001;
if ((x >= - EPSINON) && (x <= EPSINON)
if(var==NULL)
95. Object-C
BOOLif(!var)
if(var==0)
const float EPSINON = 0.00001;
if ((x >= - EPSINON) && (x <= EPSINON)
if(var==NULL)
??
Cocoa
96. Object-C
Objective
CocoaNSObject
Objective
??
ObjectiveC
NSObjectprotocol
ObjectiveC
protocol
,OO
97. volatile
volatile?
volatile
?
volatile
•
•
•
(Non-automatic variables)
(Non-automatic variables)