foo.cc: In function 'int main()':
foo.cc:38:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
~~~~~^~~~~~~~~
foo.cc: In function 'int fun1(int, int, int*)':
foo.cc:30:11: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(prime(i))
~~~~~^~~
foo.cc: In function 'int main()':
foo.cc:30:11: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(prime(i))
~~~~~^~~
foo.cc:26:6: note: 'i' was declared here
int i,k=0;
^