I've never seen this call to char() as a function before. Where is this described and what does it mean? This usage is part of the example on this cppreference.com community wiki page: https://en.cppreference.com/w/cpp/string/basic_string/resize:
short_string.resize( desired_length + 3 );
std::cout << "6. After:  \"";
for (char c : short_string) {
    std::cout << (c == char() ? '@' : c);  // <=== HERE ===
}
This wording in the description also doesn't make any sense to me and I don't understand what it's saying:
Initializes appended characters to
CharT().
Highlighted in context:
Adjacently related
- What motivated me to study the std::string::resize()method was trying to learn how to pre-allocate astd::stringfor use in C function calls as achar*buffer. This is possible by first pre-allocating thestd::stringby calling themy_string.resize()function on it. Then, you can safely write into&my_string[0]as a standardchar*up to indexmy_string.size() - 1. See also:
Update:
- 3.5 months after asking the original question, I was made aware of this question also: What does int()do in C++?

 
     
     
    