Category : class

before using iterators my code worked fine, now I used them and get tons of errors like this: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string_view:175: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:57: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:715:71: error: invalid operands to binary expression (‘const JobsList::JobEntry’ and ‘const JobsList::JobEntry’) bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} ~~~ ^ ~~~ ..

Read more

Trying to create a class that has its GPIO pins and functions that use those GPIO pins, but I am having issues initializing the GPIO driver (when called the GPIO_init function is supposed to initialize them), but when I attempt to run the code I get unresolved symbol errors error #10234-D: unresolved symbols remain error ..

Read more

In my C++ code, I made a transition from char* to std::string as I heard it’s better, but it causes a runtime error. My code is: Command *SmallShell::CreateCommand(const string &cmd_line) { //handle input which in my case was pwd string cmd_s = _trim(string(cmd_line)); string firstWord = cmd_s.substr(0, cmd_s.find_first_of(" n")); if (firstWord.compare("pwd") == 0) { return ..

Read more

why the following doesn’t compile: BuiltInCommand::BuiltInCommand(const string &cmd_line) : Command(tmp) { string tmp=cmd_line; _removeBackgroundSign(tmp); } More details if needed: I want to pass tmp to the parent constructor class Command { protected: string cmd = nullptr; vector<string> args; int num_of_args=0; public: Command(const string &cmd_line); virtual ~Command(); virtual void execute() = 0; }; class BuiltInCommand : ..

Read more