Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- if(intStack.push(word)){
- throw DatatypeError("Invalid Datatype");}
- }catch (DatatypeError& error){
- std::cout << "Exception: " << error.what() << std::endl;
- }
- ERRROR
- /cygdrive/d/Advanced C++/03/main.cpp: In function 'int main()':
- /cygdrive/d/Advanced C++/03/main.cpp:173:12: warning: init-statement in selection statements only available with -std=c++1z or -std=gnu++1z
- if(intStack.push(word);){
- ^~~~~~~~
- /cygdrive/d/Advanced C++/03/main.cpp:173:30: error: no matching function for call to 'Stack<int>::push(std::string&)'
- if(intStack.push(word);){
- ^
- In file included from /cygdrive/d/Advanced C++/03/main.h:11:0,
- from /cygdrive/d/Advanced C++/03/main.cpp:13:
- /cygdrive/d/Advanced C++/03/Stack.h:23:10: note: candidate: void Stack<stackType>::push(stackType) [with stackType = int]
- void push (stackType x);
- ^~~~
- /cygdrive/d/Advanced C++/03/Stack.h:23:10: note: no known conversion for argument 1 from 'std::string {aka std::basic_string<char>}' to 'int'
- /cygdrive/d/Advanced C++/03/main.cpp:173:32: error: expected primary-expression before ')' token
- if(intStack.push(word);){
- ^
- make[3]: *** [CMakeFiles/03.dir/build.make:63: CMakeFiles/03.dir/main.cpp.o] Error 1
- make[3]: *** Waiting for unfinished jobs....
- make[2]: *** [CMakeFiles/Makefile2:73: CMakeFiles/03.dir/all] Error 2
- make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/03.dir/rule] Error 2
- make: *** [Makefile:118: 03] Error 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement