SciYro is right. When you declare a variable, the compiler only sets aside a location for it. It
does not initialize the variable for you. You are likely to get random data if you use the variable before you initialize it (like you do in your program). The fact that st2 is 0 just means that 0 was stored there earlier by some other process.
As a side note, you're using the old C-style for memory allocation (using malloc()), C++ uses the new and delete keywords for that.
Also, I'm a bit confused why you typecast st1 and st2 as ints in one cout sequence, but not in the other. Were you expecting that to change the value? I just thought it was odd.
Code:
#include<iostream.h>
struct x{
int y;
float c;
};
typedef struct x x;
int main()
{
x *st1;
x *st2;
cout << st1 << endl << st2 << endl; //First statement
st1 = (x*) malloc(sizeof(x));
st2 = (x*) malloc(sizeof(x));
cout << (int)st1 << (int)st2 << endl; // Second statement
}