Created
August 13, 2013 10:56
-
-
Save masazdream/6220056 to your computer and use it in GitHub Desktop.
stringはそもそもchar配列ということを理解するプログラム。
This file contains hidden or 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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment