Java MYSTERY-未接受的声明

时间:2015-12-03 23:22:16

标签: java declaration

此代码生成附加图片中显示的错误,关于类from multiprocessing import Pool def func(line): # simple function as an example for i in xrange(10**7): pass return len(line) % 2 == 0, line def main(): with open('input.txt','r') as in_sr, open('output.txt', 'w') as out_sr: pool = Pool(processes=4) for ret,line in pool.imap(func, in_sr, chunksize=4): if ret: out_sr.write(line) pool.close() if __name__ == '__main__': main() 的方法intCounter中变量removeItem的声明。我无法理解为什么,并且真正地搜索了互联网。任何人都可以解释为什么编译器没有阅读这个声明吗?

Compiler Results

Remover

1 个答案:

答案 0 :(得分:1)

在main()中,intCounter尚未定义,如错误说,添加它的定义,例如

int intCounter;
for (intCounter = 0; intCounter < 12; intCounter++)