Тема: Помилка
Код:
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void f_numbers1(int n){
int d1 = 0, d2 = 1, d3;
if(n == 0)
printf("%d", n);
else if(n == 1){
printf("%d %d", n-1, n);
}else{
printf("0 1");
int i;
for(int i = 2; i <= n; i++){
printf("%d ", d3 = d1 + d2);
d1 = d2;
d2 = d3;
}
}
}
int main(int argc, char *argv[]) {
f_numbers1(15);
return 0;
}
Помилка:
14 13 D:\проекти с++\main.c [Error] redeclaration of 'i' with no linkage
14 5 D:\проекти с++\main.c [Error] 'for' loop initial declarations are only allowed in C99 or C11 mode