In C++11 you can use the keyword override to ensure that an intended override really is an override:
double auto_Estrada::getPortagem() override
{
return portagem;
}
Then you get a compilation error if it isn't an override, which this non-const function isn't (since it differs in const-ness from the base class method of the same name).
Instead of overriding the base class function this function shadows the base class function, so that if you call o.getPortagem() where o is const and of class auto_Estrada, the compiler won't find the base class const function, and complain.
In C++03 about the best you could do was to statically assert that the same named base class function could be called with the same arguments (it helped but wasn't guaranteed). Note that C++03 didn't have a static_assert. The usual way to do C++03 static asserts was via a typedef of an array, with negative size where you wanted a compile time error.
Regarding terminology,
what you call a "child class" is a derived class (C++ terminology) or subclass (more general computer science terminology, I believe originally from Smalltalk),
what you call "memory position" appears to be arbitrary bits in an uninitialized variable, interpreted as a floating point value, which is called an indeterminate value.
It's formally Undefined Behavior to use an indeterminate value, so anything can happen.
conststatus of a function is in the signature of the function, and so having a non-const function in the inherited class makes it a completely new function which hides the original const function.const, you're not overriding the function, so (depending on how you call it) you might get zero when you don't expect to. I've no idea what you mean by "return a memory position"; neither function can return anything except adouble.memory reference. A thing stored asdoubleis just a value. It may look as trash for some reason, but still it is a value like 5, 50 or 5e555. Talking here aboutmemory referencewill mislead uncareful readers. You see 'thrash' in that value most probably because it was never initialized properly and it contains semi-random data inside. Of course, it is stored in the memory at some place, and of course it has an address, but at C++-level of terminology, it is a value. It does not have any*nor&in its type that would make it an address/pointer/reference.