我一直在使用libzip来处理zip文件,并且我的代码基于rodrigo对thisquestion的回答中的示例。.这是他的代码,供快速引用:#includeintmain(){//OpentheZIParchiveinterr=0;zip*z=zip_open("foo.zip",0,&err);//Searchforthefileofgivennameconstchar*name="file.txt";structzip_statst;zip_stat_init(&st);zip_stat(z,name,0,&st);//Allocmemoryforitsuncompressedc