1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream> #include <string> int main (int argc, char *argv[]) { std::string s1 (" world"); ; s1.resize (25); for (std::string::iterator it = s1.begin (); it != s1.end (); ++it) std::cout << (int)*it << std::endl; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
32 119 111 114 108 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0