标题:不知道问题出在哪
取消只看楼主
gbsj
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-5-10
结帖率:0
已结贴  问题点数:20 回复次数:0 
不知道问题出在哪
#include <stdio.h>
#define PI 3.1415926;
void main(void)
{
double  a=3.0;
double  b=PI*a*a;
printf("\na=%f",a);
}
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2100: illegal indirection
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : warning C4552: '*' : operator has no effect; expected operator with side-effect
执行 cl.exe 时出错.

#include <stdio.h>
#define PI 3.1415926
void main(void)
{
float  f radius = 3.0;
float  f area = PI*f radius*f raduis;
printf("\n area=%f",area);
}
怎么回事我试了好多次还是有问题,求前辈指教,新手上路
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(5) : error C2146: syntax error : missing ';' before identifier 'radius'
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(5) : error C2065: 'radius' : undeclared identifier
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(5) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2146: syntax error : missing ';' before identifier 'area'
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2086: 'f' : redefinition
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2065: 'area' : undeclared identifier
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2146: syntax error : missing ';' before identifier 'radius'
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2146: syntax error : missing ';' before identifier 'raduis'
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : warning C4552: '*' : operator has no effect; expected operator with side-effect
E:\游戏\Microsoft Visual Studio\MyProjects\w\x.cpp(6) : error C2065: 'raduis' : undeclared identifier
执行 cl.exe 时出错.
求前辈赐教,谢谢
搜索更多相关主题的帖子: Microsoft expected include warning double 
2015-05-10 07:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-445079-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.160165 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved