Do I need to avoid slashes in strings in the Windows registry?

This is a question related to WinAPI RegSetValueEx. If you look at its description on MSDN here , you will find:

lpData [in] Data to be saved.

REG_SZ, the line must be zero. With the REG_MULTI_SZ type data, the string must be interrupted by two null characters. the backslash must precede another backslash as the character's escape. For example, specify "C: \\ mydir \\ myfile" to save the string "C: \ mydir \ myfile".

The question I have is, do I really need to avoid slashes? Because I have never done this before, and it worked perfectly.

+5
source share
2 answers

. . , API, . .

, , C ++ , API Win32. .

+8

, \ ++, \\ .

\ , ++ - (, \n " " ). \\ . "" (, ESC + , ).

+2

All Articles