// busError.cc  P. Conrad CISC181  02/27/06

#include <iostream>
using namespace std;

int main(void)
{
  int x = 42;

  int *y = &x;

  cout << "y=" << y << endl;

  // cast y to a char 

  char *p = (char *) y; // cast y to a character pointer

  p++; // add one to it.


  y = (int *) p; // cast it back to an integer pointer

  cout << "y=" << y << endl;

  cout << *(y) << endl;

  return 0;
}

