Altera_Forum
Honored Contributor
15 years agoscanf
Can anyone plz tell me how to input data from the keyboard ??? i'm using nios II v7.2
had tried this code earlier(input the matrix and display it) # include"system.h"# include"altera_avalon_pio_regs.h"# include"alt_types.h"# include<stdio.h># define m 5 static int a[m][m]; int main(void) { int i,j; int order; printf("\nenter the elements of array a\n"); for(i=0;i<=order;i++){ for(j=0;j<=order;j++) scanf("%i", &a[j]);}
printf("\the elements of array a\n");
for(i=0;i<=order;i++){
for(j=0;j<=order;j++)
printf("%i", &a[j]); } } and i'm getting an error as Linking hello_world_2.elf... obj/hello_world.o(.text+0x6c): in function `main': ../hello_world.c:14: undefined reference to `scanf' collect2: ld returned 1 exit status thanx