// simple program that shows that a type error can occur even without // pointers or casting when local variables are not intialized, which // means that the uninitialized variable is interpreting the bits in a // different way. If you compile with the -Wall option, you get a // warning. #include using namespace std; void foo() { char text[4]; text[0] = 'f'; text[1] = 'u'; text[2] = 'n'; text[3] = '\0'; cout << text << endl; } void bar() { int n; cout << n << endl; } int main() { foo(); bar(); return 0; }