I want to write a c array into a container and i prefer to modify it if possible. I was thinking of using vector but it does seem to have a write(*pchararray, len); function. String looked like the next best thing but that too doesnt have a write function?
Share
Given
You can use an STL
iterator:You can use a constructor:
You can resize and copy:
(and all these work similarly for string)
Thanks to comments/other answers 🙂