このコードには 2 つの異なるコンパイル エラーがあり、どちらもメインにあります。
main.c:50: エラー: ネストされた関数が無効になっています。-fnested-functions を使用して 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);
}