#include class Foo { int **array; //int *array[]; // kompiliert nicht! public: Foo(int i) { int *temp[i]; array = temp; int bar = 7; array[0] = &bar; } int* m() { return array[0]; } }; int main() { Foo foo(10); std::cout << "before segfault" << std::endl; std::cout << *(foo.m()) << " == 7 ?" << std::endl; }