示例1:
int main
{
float* theta;
*theta = 0;
return 0;
}
示例2:
int main
{
float* theta;
float width ;
theta = &width;//初始化指向
*theta = 0;
return 0;
}
示例1會報錯:段錯誤 (核心已轉儲);因爲指針theta使用之前未確定指向內存空間。
int main
{
float* theta;
*theta = 0;
return 0;
}
int main
{
float* theta;
float width ;
theta = &width;//初始化指向
*theta = 0;
return 0;
}
示例1會報錯:段錯誤 (核心已轉儲);因爲指針theta使用之前未確定指向內存空間。