我在这段代码中有两个截然不同的编译错误,都位于main中。嵌套功能被禁用
的main.c:50:错误:嵌套功能被禁用,则使用-fnested-功能重新启用 的main.c:72:错误:预期的宣言或声明,在输入端
我是什么失踪?
非常感谢!
#include <stdio.h>
#include <stdlib.h>
int ft_putline(int h, int l, int type)
{
int i;
int x;
i = 0;
x = 0;
while(type == 1) /* Cette boucle affiche la première et la dernière ligne.*/
{
if(i == 0)
{
printf("o");
i++;
}
else if(i != 0 && i < l)
{
printf("-");
i++;
}
else if(i == l)
{
printf("o");
printf("\n");
type = type - 1;
}
while(type == 0 && x >= h - (h - 1) && x <= h - 1)
{
i = 0;
x = 0;
if(i = 0)
{
printf("|");
i++;
}
}
}
int main()
{
int l;
int type;
int h;
l = 0;
type = 1;
h = 0;
printf("quelle est la largeur du rectangle ?\n");
scanf("%d", &h);
printf("quelle est la hauteur du rectangle ?\n");
scanf("%d", &l);
return (0);
}
欢迎来到Stack Overflow。请尽快阅读[关于]页面。这将有助于包含确切的错误消息和行号 - 并在您包含的代码中标识这些行。 –
您缺少一个右括号。如果保持代码的一致缩进,这将更容易看到。 – shf301
“我错过了什么?”特定的错误消息,发生错误的行号以及正确的代码缩进。 –