Hi,

I am not sure if this question is appropriate for a Qt forum, since it is a general c++ question.

The following code won't compile:

int *p;
*p=7;
cout<<*p;

When I create the pointer p, the compiler assigns a random adress and a random int value for p. On the second line of code, I try to change the int value that the compiler has previously assigned for p and on the last line it should output this value. All the Qt compiler says is: 'the program has unexpectedly finished'. Any suggestions why this happens?


Thank you