I have a buffer like this:
vector buf
How can I cast it to char*?
If I do:
(char *)buf
Try
(char *)(&buf[0])
or another, more C++ cast. But also tell us what you're using this for. It may be a bad idea.