0

hi, for the last half hour or so i have been trying to get this line of code to work

system("del %APPDATA%\\Microsoft\\Windows\\Start Menu\\*.vbs");

but i keep getting errors, so far i have tried wrapping start menu using escaped quotes but im yet to get it work .
any help would be appreciated

0

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 Object();
    Object *b = new Object();
    Object *c = new Object();
    Object *d = new Object();

    _c["dbdb"] = a;
    _c["dbh"] = b;
    _c["dbdfgdb"] = c;
    _c["dbdbgdsfg"] = d;

    for( std::map<string, Object>::iterator itr=_c.begin(); itr < _c.end(); itr++)
    {

        }

}
0

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
            }
1

You need to provide the absolute path to tell the compiler where to find the header file

 #include "C:\Users\Raheel\Desktop\test c++\prog\header\"

Solution

You have to configure the project build and add the directory where the header file is located. The steps are as below:-

Project > Build options > Search Directories tab
Choose the Policy dropdown list with the option: Prepend target options to project options”
Click the button ‘Add’ to search and add the directory (e.g. ‘include’ directory)
Another popup with the question “Keep this as a relative path?” and click ‘Yes’ to add the directory.

0

thanks for the quick reply. i tried your example and i did not get back the same errors only

E:\Project3\Project3\story.h|2|error: '$define' does not name a type|
E:\Project3\Project3\story.cpp|8|error: 'Story' does not name a type|
E:\Project3\Project3\story.cpp|12|error: 'Story' does not name a type|
E:\Project3\Project3\story.cpp|16|error: 'Story' has not been declared|
E:\Project3\Project3\story.cpp|21|error: 'Story' has not been declared|
E:\Project3\Project3\story.cpp|27|error: 'Story' has not been declared|
E:\Project3\Project3\story.cpp|32|error: 'Story' has not been declared|
||=== Build finished: 7 errors, 0 warnings ===|
0

hello ive been working with c++ for a few weeks now and from yesterday ive attempting to write a console game but i keep getting an error.

//where all the noise is coming from

class Story{

public:
    Story();
    ~Story();
    void mainMenu();
    void start();

private:
    void levelOne();
    void judgement();
};

Story::Story(){

}

Story::~Story(){

}

//error console

obj\Debug\E\Project3\Project3\GameLoop.o||In function `Story':|
E:\Project3\Project3\story.h|16|multiple definition of `Story::Story()'|
obj\Debug\E\Project3\Project3\story.o:E:\Project3\Project3\story.h|16|first defined here|
obj\Debug\E\Project3\Project3\GameLoop.o||In function `~Story':|
E:\Project3\Project3\story.h|20|multiple definition of `Story::~Story()'|
obj\Debug\E\Project3\Project3\story.o:E:\Project3\Project3\story.h|20|first defined here|
obj\Debug\E\Project3\Project3\GameLoop.o||In function `Story':|
E:\Project3\Project3\story.h|16|multiple definition of `Story::Story()'|
obj\Debug\E\Project3\Project3\story.o:E:\Project3\Project3\story.h|16|first defined here|
obj\Debug\E\Project3\Project3\GameLoop.o||In function `~Story':|
E:\Project3\Project3\story.h|20|multiple definition of `Story::~Story()'|
obj\Debug\E\Project3\Project3\story.o:E:\Project3\Project3\story.h|20|first defined here|
||=== Build finished: 8 errors, 0 warnings ===|
0

unfortunately i did not get our solution to work i kept getting an error "file or directory not found" however after a little digging Here i realized that to get subprocess() to execute "nano path" i would have to supply arguments as alist eg.

import subprocess

path = "somefile.txt"

subprocess.call([nano, path])
0

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