Last post Mar 30, 2017 12:25 PM by PatriceSc
Mar 28, 2017 01:41 PM|lord.balrog|LINK
I have this code:
Char secretKey = "theSecretKey".ToCharArray();
My question is, am I exposing the string "theSecretKey" in the memory or it wont and just create a char array in the memory? Thanks!
Mar 28, 2017 02:50 PM|deepalgorithm|LINK
The method returns a newly allocated char array that is mutable. Which means its state can be changed by calling various operations on it.
Mar 30, 2017 12:25 PM|PatriceSc|LINK
I would say the string itself is also stored in memory (ie it is evaluated at runtime rather than at compile time). Anyway it wouldn't change anything as the memory layout for a string or a character array is basically the same so I doubt turning a string
into a char array makes really harder to find this string in memory.