Dear all,
I am running a program and in one of the functions I have to sort the
data of an array as follows:
..
..
..
for (m=0;m<M;++m) //Sort
{
k=m;
for (j=m+1;j<M;++j)
{
if (DT[j]<DT[k]) k=j;
}
Temp=DT[m];
DT[m]=DT[k]; <<-----The 'Valgrind' gives error in this line
DT[k]=Temp;
}
..
..
..
When I check my program by 'Valgrind', it gives me the following
sentence which is pointing to error in the line that I have pointed in
the program.
==11285==
==11285== Source and destination overlap in memcpy(0x4A33358,
0x4A33358, 400)
==11285== at 0x4906C4A: memcpy (mac_replace_strmem.c:394)
==11285== by 0x4014F8: SP(Record*, Record*) (925.cpp:601)
==11285== by 0x40EDF5: main (925.cpp:197)
Is it really an error? I have just substituted the elements of an array!