This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string line2; | |
cout << "何か数字を入力してください> " << flush; | |
getline(cin, line2); | |
cout << line2 << endl; | |
const char* line_array = line2.c_str(); | |
const int size = line2.size(); | |
cout << "文字列配列の長さ: " << size << endl; | |
for(int i = 0; i < size; ++i){ | |
unsigned char c = (unsigned char)line_array[i]; | |
cout << c << endl; | |
} |
0 件のコメント:
コメントを投稿