嗨,我昨天已经问了这个问题而且因为不被理解而被关闭了,所以我会尝试更具体,因为这次我可以.所以情况就是这样.
1.我有3个字符:字符数组中的A,B,C如下:
char[] characters = {'A', 'B', 'C'};
Run Code Online (Sandbox Code Playgroud)
2.在枚举这3个字符的所有可能匹配时,我得到例如以下内容:
Text = A
tries = 1
indexes = characters[0]
------------
Text = B
tries = 2
indexes = characters[1]
------------
Text = C
tries = 3
indexes = characters[2]
------------
Text = AA
tries = 4
indexes = characters[0] characters[0]
------------
Text = AB
tries = 5
indexes = characters[0] characters[1]
------------
Text = AC
tries = 6
indexes = characters[0] characters[2]
------------
Text = BA
tries = 7 …Run Code Online (Sandbox Code Playgroud) 这是一个初学者类型的问题
我只是想知道是否有办法将空终止的char*转换为std :: list.
谢谢
char* data = ...
std::list<char> clist = convert_chars2list(data);
...
convert_chars2list(char* somedata)
{
//convert
}
Run Code Online (Sandbox Code Playgroud)