I don't understand a sentence in c++.
阿神
阿神 2017-06-22 11:53:34
0
2
885
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

阿神
阿神

闭关修行中......

reply all(2)
过去多啦不再A梦

: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.

Peter_Zhu

This performs an operation that can be dangerous if you don't know what you are doing. This keyword removes the constqualifier

from the variable.
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!