推荐 最新
一颗西兰花

C++代码为什么总提示"expected a declaration"错误?

//gua.cpp #include "gua.h" #include #include #include using namespace std; const string guaming[] = {"乾","兑","离","震","巽","坎","艮","坤"}; const vector yao[] = {{"阳","阳","阳"},{"阳","阳","阴"},{"阳","阴","阳"},{"阴","阴","阳"},{"阴","阳","阳"},{"阴","阳","阴"},{"阴","阴","阳"},{"阴","阴","阴"}}; const string wuxing[] = {"金","金","火","木","木","水","土","土"}; map guaIndex; /*用于快速查找八卦名称的索引号*/ for (int i = 0; i < 8; i++) { guaIndex[guaming[i]] = i; } /*以下代码省略*/ 为什么在for语句那里提示"expected a declaration."错误? 希望高手能帮忙找出根本原因,是在看不出哪里有语法错误!

0
1
0
浏览量12