/* segFault3.c  P. Conrad 9/16/05

This file should make a segmentation fault
even earlier, because here we got the format
specifier wrong on BOTH the scanf and the 
second printf.

*/

#include <stdio.h>

int main(void)
{
  int x; /* this is a declaration for the variable x */

  x = 1; /* this is an assignment statment */

  /* since that was the "first" assignment to x, it
     might be consider the "initial" assignment to x,
     therefore it is sometimes called the "Initialization" */


  printf("enter value for x:");
  scanf("%s",&x);  

  printf("This printf will work normally: x=%d\n",x);

  printf("The next printf will probably bomb out\n");
  
  printf("x=%s\n",x); /* %s should be %d */

  return 0;

}

