In below code, I expect 1 to be initialized in all the 10 elements in x array. But, it doesn't seem to be working. May I know what I am missing here
int main() {
int *x = new int[10];
//std::cout<<"address of x: "<<&x<<std::endl;
for(int i =0; i <10; ++i){
*x = 10;
x++;
}
for(int i = 0; i < 10; ++i)
std::cout<<i<<" is "<<x[i]<<std::endl;
return 0;
}