std::string data = "username=15111651349&password=qq1990086708&client=wap";
const void *ss = (const char *)data.c_str();
bResults = WinHttpSendRequest(hRequest, 0, 0, const_cast<void *>(ss), data.length(),
data.length(), 0);
const_cast<void *>(ss)
I don’t understand this sentence
:const_cast<type_id> (expression)
This operator is used to modify the const or volatile attribute of the type. Except for the const or volatile modification, the types of type_id and expression are the same.
1. The constant pointer is converted into a non-const pointer, and still points to the original object;
2. The constant reference is converted into a non-const reference, and still points to the original object;
3. const_cast is generally used to modify the bottom pointer . Such as const char *p form.
This performs an operation that can be dangerous if you don't know what you are doing. This keyword removes the
from the variable.const
qualifier