[!!Correction made to the second code!!]
vector<int> a;
vector<int>*p = &a;
and
vector<int>*b = new vector<int>();
I know that in first scenario, a is on stack and in second b is on heap. But, are there any other differences? Like memory consumed etc.
Yes vector b is allocated on the heap and vector a is on the stack (assuming the code is in the scope of a method) along with a 4 byte pointer also on the stack. Other differences in memory consumed would depend on the memory manager and how it allocates blocks and any internal bookkeeping required for the heap.