0

Hopefully this is an easy one for someone out there. I need to append a long command that has strings and variables in it.

this->AppendHeader("Content-Range", "bytes " + offset "-" + (offset + part_size - 1) "/" + file_size);

This is not acceptable in C++. How can I format the above so the Header looks like

Content-Range: bytes 0-19/40

(just a fyi - offset is 0, part_size is 20 and file_size is 40)

2
  • 1
    I am not a C++ developer but is what you are looking for String interpolation? like this? stackoverflow.com/questions/10219225 Commented Apr 20, 2018 at 9:50
  • @Landy Thanks! I think it was the "/" it didnt like. I used single quotes and it seemed to compile. Commented Apr 20, 2018 at 10:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.