Errors, bugs, questions - page 1109

 
but this way it doesn't report an error either

#define  MCR


int OnInit()
{
        EventSetTimer(10);
        return ( INIT_SUCCEEDED );
}

ifdef  MCR
        #define  NUM             1
#else
        #define  NUM             2
#enif //случайная ошибка

void OnTimer()
{
        EventKillTimer();
        Print( NUM );
}
 
So
class A {
public:
        void f() {}
};

void OnStart()
{
        const A a;
        a.f(); //компилятор выдает ошибку

}
the compiler justifiably gives an error, but this way
class A {
public:
        void f() {}
};

void OnStart()
{
        const A *a = new A();
        a.f(); //компилятор не выдает ошибку
	delete ( a );
}

it doesn't. What's the difference?
 

Why does one MetaQuotes-Demo terminal 910 in the "News" tab have a "Time" column

and the same one on a different computer does not?


And the "Categories" menu is different. Computers are identical, OS=Windows 7. The Expert Advisors are not running. In Brokerage 880 terminals on physically different computers, all other things being equal, the picture is similar except that the "Categories" menus are the same.

 
Compilation error.
class A {
public:
        void f( int z ) { a = z; }
        int a;
};

class B {
public:
        B() { a = new A(); }
        ~B() { delete( a ); }
        void g( int z ) const { a.f( z ); } //error: call non-const method for constant object
        A *a;
};

Why is there an error?

the non-constant a.f( z ) itself cannot change the pointer B::a, only the object A to which it points can change it. But object A is not a member of B, so it is not subject to change protection. If you replace . with ->, everything compiles in C++ without errors. If it were declared

class B {
public:
//...
        const A *a;
};
then yes - not only the pointer to the object must not be changed, but the object itself must not be changed and there would be an error
 

Try to open the attached file err1.mqh in MetaEditor=910

Assume OS=Windows 7\32, that err1.mqh and err2.mqh exist and that the route of err2.mqh in err1.mqh is correct (or they are in the same folder), and the following MetaEditor settings

I can't even get it to open. I excluded unnecessary code, left only the essence of the problem - a few lines

Files:
Err1.mqh  1 kb
Err2.mqh  1 kb
 

What is going on with this thread? Every five minutes the forum shows that there are new posts in this thread - but when you come in it turns out that there is nothing here.

P.S. Stop endlessly making minor edits to your posts to bring the topic to the top.

 

What is this issue of the magazine from the future?

future

 
barabashkakvn:

What is this issue of the magazine from the future?


well... the portal has closed... there's no more issue for that date... (((

for me anyway.

 
And when will the repository be connected to MetaEditor4?
 
barabashkakvn:
When will the repository be connected to MetaEditor4?
It is already connected.