Q:

Segmentation fault: 1902 vfscanf.c: No such file or directory

I try to write a C program at newly installed Debian system. The program stops with segmentation fault at scanf() function.
This is simplified code:
int main() {
  int x = 0;
  printf("$ ");
  scanf("%i", x);

  return 0;
}

And when I run this with gdb I get this message:
(gdb) run
Starting program: /home/siery/dev/shell/classes/bin/Recure 

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff71f6794 in _IO_vfscanf_internal (s=<optimized out>, format=<optimized out>, argptr=argptr@entry=0x7fffffffe608, errp=errp@entry=0x0) at vfscanf.c:1902
1902    vfscanf.c: No such file or directory.

It worked fine to use stdio.h library with printf() and few other functions. I try to search the Internet for vfscanf.c and find not to much helpful information.
Btw. I compile this program with g++ which is newly updated same as gdb.

A:

scanf("%i", &x);
//          ^ THIS IS THE IMPORTANT BIT

gcc even tells you about this:
foo.c: In function ‘main’:
foo.c:6:9: warning: format ‘%i’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
   scanf("%i", x);
         ^

The vfscanf.c: No such file or directory is just gdb complaining that it can't find the source code for scanf.

