I need some theoretical explanation of the following memory access violation BEFORE even entering the method:
String testMethod (AnsiString param1); AnsiString A1 = testMethod(A1);
I am trying to understand the theory behind the problem.
A1 is getting initialized by the return value of
testMethod() while at the same time it is passed to
testMethod(). What happens before the method is actually entered? When passed to
testMethod() it has no actual value/a random value, has it? A local copy of
A1 is created, does the exception occur during that process, actually?
Trying to debug, a lot of
AnsiStringBase methods are entered.
Why does it work, when I change the method signature this way:
AnsiString testMethod (AnsiString param1);
Source: Windows Questions C++