Hi everyone !
I'm writing something in QSharedMemory in one process and then in the other process I read from it and I want to clear the contents.
How can I do that?
Hi everyone !
I'm writing something in QSharedMemory in one process and then in the other process I read from it and I want to clear the contents.
How can I do that?
C++ & AMD forever
Overwrite it with zeroes.
Thanks for your reply but after a minute after I posted this thread I did like this
It worked.Qt Code:
char* pPath = (char*)sharedMem_->data(); memset(pPath, '\0', strlen(pPath)+1);To copy to clipboard, switch view to plain text mode
Thanks anyway![]()
C++ & AMD forever
Yeah, you have overwritten it with zeroes :] BTW. I wouldn't use strlen() here, if I were you. You might end up clearing only part of the block this way.
I read only one string from shared memory so I don't mind if the part that is behind my string contains garbage![]()
C++ & AMD forever
Bookmarks