Skip to content

Commit 9e18575

Browse files
string_from_char.cpp
1 parent 3e27080 commit 9e18575

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

string_from_char.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <iostream>
2+
#include <typeinfo>
3+
4+
using namespace std;
5+
6+
int main()
7+
{
8+
char c = 'c';
9+
//method1: output "Ss"
10+
cout << typeid(string(1, c)).name() << endl;
11+
return 0;
12+
}

0 commit comments

Comments
 (0)