c++ - 'myStateType' was not declared in this scope caused by #typedef -
i tried use #typedef declare type own customized name convenient use:
class solution { public: void dfs(vector<vector<char>>& board, int i, int j) { using namespace std; #typedef std::pair<int, int> mystatetype; std::queue<mystatetype> q; // error on line ... } }; however, compile error indicated on line std::queue<mystatetype> q;:
'mystatetype' not declared in scope
i still haven't figure out how error have happened? ideas? in advance!
typedef compiler token in c , c++ programming languages, not macro.
typedef std::pair<int,int> mystatetype; // don't put # before std:queue<mystatetype> q; 'mystatetype' not declared in scope: means programm not aware of type: mystatetype
Comments
Post a Comment