printf("The Volume of the cuboid with a height of%d", height);
printf("and width of%d\n", width);
printf("and depth of%d\n", depth);
printf("Gives you the Volume of %lf\n", vcuboid);
“volumeofcuboid.c:5:错误:此处未声明“height”(不在函数中)volumeofcuboid.c:5:错误:此处未声明“width”(不在函数中)volumeofcuboid.c:5:错误:此处未声明“深度”(不在函数中)“
最佳答案
对于初学者:
#!/bin/bash
C 不是 shell 脚本。即使您使用的是 cshell,也不会。
vcuboid(高度、宽度、深度);
不是有效的函数原型(prototype),并且您从未提供实际的函数。
main()
不是 main()
的有效定义,应该是 int main(void)
。
vcuboid=((高*宽*深));
vcuboid
尚未定义。
只是,不。
退出(0);
返回0;
关于计算立方体的体积,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18112480/