text: I understand the placement new operator allows to construct object at a particular/specific memory location. So i tried this;
  #include <iostream>
  #include <new>
  using namespace std;
  struct Any {
  int x;
  string y;
  };
  int main() {
  string mem1[1];
  int mem2[5];
  Any *p1 = new (mem1) Any;
  Any *p2 = new (mem2) Any;
  p1->y = "Hello";
  //p2->x = 20;
  cout << p1->y << endl;
  //cout << p2->x;
  return 0;
  }
  int mem2[1];
  Any *p2 = new (mem2) Any;
  p2->x = 20;
  20
  p1->y
  int mem2[5];
  5
  >= 5
  You have sets of Undefined Behavior in your code.
  First of all, there's no guarantee that the declaration
  string mem[1]; sets aside enough memory to contain an abject of type
  Any....
  Secondly, even if the first had adequate memory to hold such object, the destructor of the array
  string mem[1]; will still run at the end of main, but you've overwritten that array with something else, hence your program should at best case, crash.
  You may want to use a POD type, like
  char mem1[sizeof(Any)] to store the object, that way you are sure of
  mem1 being capable enough to store
  Any, and you'll have no issues with destructor of
  mem1 being called at the end of
  main()
  Again, you may want to explore a standard facility for this kind of thing,
  std::aligned_storage