stringMatching Errs
2011-05-25 12:48
127 查看
]#include<stdio.h> #include<string.h> int stringMatching(char* pattern, char* text){ int pLen=strlen(pattern),tLen=strlen(text); for(int i=0;i<=tLen-pLen;i++){ for(int j=0;pattern[j]=text[i+j];j++); if(j==pLen) return i; } return -1;//Not Found } int main(){ char a[ ]; char b[ ]; printf("请输入一行字符,在100个字以内/n"); gets(a); printf("请再输入一行字符,比前者长/n"); gets(b); stringMatching(a,b); }
错误表明:
[Error] D:/Program Files/C-Free 5/mingw/include/c++/3.4.5/strMatching.cpp:7: error: using obsolete binding at `j'
[Error] D:/Program Files/C-Free 5/mingw/include/c++/3.4.5/strMatching.cpp:14: error: storage size of `a' isn't known
[Error] D:/Program Files/C-Free 5/mingw/include/c++/3.4.5/strMatching.cpp:15: error: storage size of `b' isn't known
我知道是我的main函数写的有问题,可是该怎么改呢?
相关文章推荐
- G++编译错误 no matching function for call to '_tag_data_value::StringAddLen(std::string, int, int)
- Binary String Matching
- NYoj 5 Binary String Matching
- Binary String Matching
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e
- hihocoder #1059 : String Matching Content Length
- hiho一下 微软笔试题《String Matching Content Length》
- Binary String Matching
- nyoj -5 Binary String Matching 【kmp】
- NYOJ 5-Binary String Matching
- NYOJ Binary String Matching
- 【求助】 no matching function for call to `strcpy(std::string&, char*&)'
- Rabin Karp Matching: String Matching
- Nswoj每日一题:Binary String Matching
- 【Binary String Matching 5】
- NYOJ 5 Binary String Matching(数据结构)
- NYOJ5Binary String Matching(find函数用法)
- Aho-Corasick string matching in C#
- ny 5 Binary String Matching
- NYOJ-----5---Binary String Matching(KMP)