1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <algorithm> #include <iostream> int to_codepoint( char c ) { return (int)c; } int main(){ char cs []= "abcd"; int is[4]; std::transform( cs, cs+strlen(cs) , std::ostream_iterator<int>( std::cout, ", " ), to_codepoint); }
1
97, 98, 99, 100,