The Problem is the following:
There is the call of a constructor, where a pointer is an argument
m_pszBuf= new char[260];
//Still valid , to prove i'm printing the address
std::cout <<"Address "<< (void*)m_pszBuf <<std::endl;
device = new Device(m_pszBuf);
Device::Device(char* _ptr){
strcpy(dest,_ptr);
}
Interesting is, before the call of the constructor, the pointer is still valid and has an address and value, but as soon as it entered the ctor, it becomes a bad pointer (0x0000005c). In addition, it is working in the debug mode but not in the release mode.