I want to use std::vector for dynamically allocating memory. The scenario is:
int neededLength = computeLength(); // some logic here // this will allocate t
but this &(buffer[0]) looks ugly
&(buffer[0])
It’s the normal way. You can omit the parentheses, though:
&buffer[0]