mun*_*uni 4 c pointers c-preprocessor
我尝试通过"简单地"计算圆圈来学习使用函数中的指针.我得到错误,expected expression before '=' token
但无法理解为什么.说...之前的预期表达对我来说不清楚,是什么样的?
#define PI = 3.1415f
void circle(float *wert) {
*wert = ( (*wert) * (*wert) * PI );
}
int main(void) {
float radius;
printf("radius input: ");
scanf("%f", &radius);
circle(&radius);
printf("the circle size will be: %f", &radius);
}
Run Code Online (Sandbox Code Playgroud)
#define PI = 3.1415f
Run Code Online (Sandbox Code Playgroud)
应该
#define PI 3.1415f
Run Code Online (Sandbox Code Playgroud)
在3.1415的代码中使用时,宏PI将被替换
归档时间: |
|
查看次数: |
939 次 |
最近记录: |