ive been trying to improve my skills when it comes on to using maps and iterators but i seem to be mostly failing can someone please tell me where im going wrong or point me in the right direction compiler error a.cpp:20:55: error: conversion from ‘std::map<std::basic_string<char>, Object*>::iterator {aka std::_Rb_tree_iterator<std::pair<const std::basic_string<char>, Object*> >}’ to non-scalar type ‘std::map<std::basic_string<char>, Object>::iterator {aka std::_Rb_tree_iterator<std::pair<const std::basic_string<char>, Object> >}’ requested a.cpp:20:71: error: no match for ‘operator<’ in ‘itr < _c.std::map<_Key, _Tp, _Compare, _Alloc>::end<std::basic_string<char>, Object*, std::less<std::basic_string<char> >, std::allocator<std::pair<const std::basic_string<char>, Object*> > >()’ my code #include "object.hpp" #include <map> int main() { std::map<string, Object*> _c; Object *a = new …

Member Avatar
Member Avatar
+0 forum 4

hello im a hobbyist who is somewhat new to c++ with lots of experience in python. in python i was able to use dictionaries that could be accessed by keys and values with no limits on data types that can be stored but now im trying to port a simple app i create in python to c++ that depended heavily on dictionaries. so im asking for a little guidance here #python code i want to recreate in c++ sTo = {"mile":1,"Nautical mile":0.868423,"Nautical League":0.289474,"Furlong":8,"Chain":80,"rod":320,"yard":1760,"Feet":5280,"inch":63360, "Km":1.609344,"Hm":16.09344,"Meter":1609.344,"Dm":16093.44,"Cm":160934.4,"Mm":1609344,"Light Second":0.00000536819 }

Member Avatar
Member Avatar
+0 forum 5

hello ive been working on a small project and im a bit stuck. import subprocess path = "/var/log" #i wanna be able to do something like subprocess.call("nano path") # but i noticed that using nano like that wont work because path is just a python string any help

Member Avatar
Member Avatar
+0 forum 4

The End.