#include <stdio.h>
#include <stdlib.h>
//Fibonacci
void fibonacci(int n, int *fibs[n]){
int i;
*fibs[0] = 1;
*fibs[1] = 1;
printf("%d %d ", *fibs[0], *fibs[1]);
for(i=2; i<=n; i++){
*fibs[i] = *fibs[i-1] + *fibs[i-2];
printf("%d ", *fibs[i]);
}
}
int main(){
int n, i;
printf("How many fibonacci numbers do you want to enter?: ");
scanf("%d", &n);
int fibs[n];
fibonacci(n, &fibs);
return 0;
}
I was writing a Fibonacci program in this way. The program runs but does not print anything. And I get the error like, [Warning] passing argument 2 of 'fibonacci' from incompatible pointer type
How can I fix this program to run efficiently?