给出2组字符串数组A=[QWERQWERQWERQWERQWER]
和B=[QWERREWQQWERREWQQWER] ,把A和B中的字符串4个为一组短开后,然后比较A和B中断开后的小字符串.看是否有想同的.如果A中有字符串和B中的字符串一样.输出1,否者输出0.谢谢各位高手们,希望各位高手们能给予解答.谢谢
和B=[QWERREWQQWERREWQQWER] ,把A和B中的字符串4个为一组短开后,然后比较A和B中断开后的小字符串.看是否有想同的.如果A中有字符串和B中的字符串一样.输出1,否者输出0.谢谢各位高手们,希望各位高手们能给予解答.谢谢
解决方案 »
- 对话框打开时的界面过度效果消除问题请教?
- 一个很值得探究的问题
- 能否使用wavein系列API提高采集的音量
- VS的项目设置 如何按"调试按钮"也就是F5 它会自动把工程编译并连接后才今日调试
- MSXML的节点名称总是不能是变量,请高手帮帮忙,谢谢!
- 几个小问题求助!!!!
- 请问如何用代码删除已有的网络协议或网络适配器?????
- 链接时老是出现这样的提示,不知咋办。help
- 高分求教,用什么函数可以判断Windows使用的是 large fonts 还是 small fonts ?
- 我写了个开放源代码的中文“类c语言”集成开发环境
- 新手求教,如何将一个long数据放入一个字符串
- 利用MFC,比较分段字母,相同的内容连线.
A=[QWER,QWER,QWER,QWER,QWER]
B=[QWER,REWQ,QWER,REWQ,QWER]还是任意断?
比如 QWER, WERQ, ERQW...
CString str1(A);
CString str2(B);
CString temp;
for(int i=0; i<str1.GetLength(); i+=4)
{
temp = str.Mid(i,4);
for(int j=0; j<str2.GetLength(); j+=4)
{
if( str.CompareNoCase( str2.Mid(j,4) ) == 0 )
return 1;
}
A=[QWER,QWER,QWER,QWER,QWER]
B=[QWER,REWQ,QWER,REWQ,QWER]
谢谢解答,谢谢
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(99) : error C2228: left of '.Mid' must have class/struct/union type
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(102) : error C2228: left of '.CompareNoCase' must have class/struct/union type
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(110) : warning C4390: ';' : empty controlled statement found; is this the intent?
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(116) : error C2601: 'OnPreparePrinting' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(122) : error C2601: 'OnBeginPrinting' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(127) : error C2601: 'OnEndPrinting' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(136) : error C2601: 'AssertValid' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(141) : error C2601: 'Dump' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(146) : error C2601: 'GetDocument' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(154) : fatal error C1004: unexpected end of file found
Error executing cl.exe.4View.obj - 10 error(s), 1 warning(s)2楼的朋友。我把你说的源代码放到了OnDraw内部。结果出来这么多的错误。请指点什么步骤出错了。怎么样修改。谢谢你
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(99) : error C2065: str : undeclared identifier
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(99) : error C2228: left of .Mid must have class/struct/union type
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(102) : error C2228: left of .CompareNoCase ' must have class/struct/union type
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(110) : warning C4390: ; : empty controlled statement found; is this the intent?
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(116) : error C2601: 'OnPreparePrinting ' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(122) : error C2601: OnBeginPrinting : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(127) : error C2601: OnEndPrinting : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(136) : error C2601: AssertValid : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(141) : error C2601: Dump : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(146) : error C2601: GetDocument : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\10.30\4\4View.cpp(154) : fatal error C1004: unexpected end of file found
Error executing cl.exe. 4View.obj - 10 error(s), 1 warning(s) 具体是哪里出错了,我没有找出来,希望你能指点指点,谢谢你。
str改为str1,
注意上边,我贴出来的少了一个大括号你不要只给出错误提示
至少给出错误行
CString str1 = "QWERQWERQWERQWERQWER";
CString str2 = "QWERREWQQWERREWQQWER";
CString temp;
for(int i=0; i<str1.GetLength(); i+=4)
{
temp = str1.Mid(i,4);
for(int j=0; j<str2.GetLength(); j+=4)
{
if( temp.CompareNoCase( str2.Mid(j,4) ) == 0 )
return 1; }
} 2楼比较的时候对象错了
str2 = "WERREWQQWERREWQQWER"; 开始,再比较,不断的循环,一直到STR1和 STR2 中的字母少与4个无法分段比较为止。。请问该怎么做。谢谢赐教。