- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
#include <iostream>
#include <string>
int main()
{
std::string s1 = "";
const char s2[] = "";
std::cout << std::boolalpha
<< std::empty(s1) << std::endl
<< std::size(s1) << std::endl
<< std::empty(s2) << std::endl
<< std::size(s2) << std::endl;
s1.assign("", 1);
std::cout << std::empty(s1) << std::endl
<< std::size(s1) << std::endl;
system("pause");
return 0;
}
Follow us!